I’m trying to use jQuery to rotate an image 90 degrees upon click on my div.
Why doesn’t it work?
Here’s my HTML …
<div class="class1">
<div class="class2">
<img id="whatever">
</div>
</div>
.. and here’s my jQuery ;
jQuery(document).ready(function() {
jQuery(".class1").click(function()
{
jQuery(this).find('img').rotate({animateTo:-90})
});
});
If it helps,
http://code.google.com/p/jqueryrotate/wiki/Examples
NOTE: I need the code to FIND the first image…not just get the image by id, then rotate it.
According to @Abdullah Jibaly post and look at comment. I think you miss something like
And here is an example to rotate at first image http://jsfiddle.net/oamiamgod/BeUBF/2/