I have fourli div
that have inside a link of an image (so they're four links and four images), but I can't understand why the hover function doesn't work here .
The error is :
element.hover isn't a function:
var element =$("li div")var element_link = element.find("a");var element_img = element.find("img");element_img.css("opacity","0.5");element_link.each(function(index, element) { element.hover( function(){element_img[index].animate({opacity:1}),250}, function(){element_img[index].animate({opacity:0.5}),250} );});
How can I fix this problem?