I’ve the next problem: I’ve got a div which contains an image.
I need this image resized if is bigger than the width of the div, and if the user click the image, show it at the full size.
The div width is managed with the windows width.
How do I do that?
You can use the .css() function to set the size of the image, or if you want to make it a bit spiffier, you can use .animate() to animate the change.
Say your image’s id is #myimage, this is how you would do it.
This assumes you already saved away the original size of the image, since otherwise, there’s no way to calculate how big the picture used to be.
EDIT:
Assume your div’s id is #mydiv
the $(document).ready() is called when the page finishes loading.