Quantcast
Viewing latest article 3
Browse Latest Browse All 3

Hover function in jQuery doesn't work

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?


Viewing latest article 3
Browse Latest Browse All 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>