When using the this
selector to animate an image within the li
and a
elements, I encountered a problem.
Here is the Jquery code snippet:
jQuery(document).ready(function () {
jQuery(".jcarousel-skin-tango li").mouseenter(function () {
jQuery(this).children("a").children("img").animate({
top: '10px'
}, 2000);
});
});
And here is the corresponding HTML code:
<ul id="mycarousel" class="jcarousel-skin-tango">
<li>
<a href="http://google.com/">
<img alt="" src="item1.gif" /><span>adfadf</span></a>
</li>
</ul>
I'm wondering why the image has no effect on mouse enter. Any ideas?