Javascript variables use in HTML [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to use "screen.availWidth" and "screen.availHeight" to change the size of a image. How can I do it?
Here is my code I want that that work.
<img src="logoDK.png" alt="" width="screen.availWidth/1.9" height="screen.availHeight/3.84">
Thanks for your help.

This could works, if you are using query
$('#myimage').width(screen.availWidth);
$('#myimage').height(screen.availHeight);
You can use the event resize, to detect windows resize event and update the size.
$( window ).resize(function() {
});

Related

Crop images by x,y,w,h [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to crop images ..
I get the x,y,w,h data by JCrop plugin ..
So i want just to know if is there any technique to crop the image in javascript based on my (x,y,w,h) data .
Thank you .
Have you tried getImageData? See:
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas#Getting_the_pixel_data_for_a_context

Background shift on mouse position [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I saw this wonderful effect at: http://www.dogstudio.be/
I was wondering how you replicate it? I am talking about the shifting of the image depending on the mouse moments, and the effects.
Try to look here: jQuery: Fullscreen "background" image that moves according to mouse position
http://manos.malihu.gr/jquery-image-panning/
http://manos.malihu.gr/repository/jquery-image-panning/demo/multiple-instances.html

(Javascript) How to make a image open double link [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How to create a code like this. when an image is being clicked and 2 links will open, one in the same window and another as a pop-up windows.
HTML
<img src="http://www.firefall.cc/wp-content/uploads/2015/02/start-download-crack.gif" class="yourlink">
JS:
<script>
$('img.yourlink').click(function(e) {
e.preventDefault();
window.open('http://livemecca.blogspot.com');
window.location.href = 'http://firefall.cc/';
});
</script>

How to animate website on page change?" [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to make a website where the displayed page moves down outsite the display when I click a button, before the new page gets loaded. How can I achive that?
You could use 2 iframes, in which the first and the second website are shown and the animate them with javascript. Maybe this could help you: https://stackoverflow.com/a/8382328/3902603
EDIT:
Here is an example: http://bit.ly/10sWJxZ
You will just have to put your jframes into the divs

Multitouch for two draggables Jquery [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have two draggables that work as a joystick. So, I have to be able to get one event in each joystick.
I am using a library called touch-punch but it is not multitouch. I have created my own listener but now I can't drag. Any idea?
Use one event for both joysticks. Then use event.changedTouches[0].pageX; and event.changedTouches[1].pageX; to get the first and second touches.

Categories