Reputation: 15
i have a blog where i am using the fade effect on mouseover and mouseout changing image opacity. well, the problem is that my blog have infinite scroll and when it load more images, they doesn't appear with the effect :S
here is the jquery im using:
<script type='text/javascript'>
$(document).ready(function(){
$("#entry img.photo").on({
mouseover: function() { $(this).fadeTo('slow', .5); },
mouseout: function() { $(this).fadeTo('slow', 1); }
});
});
</script>
and there is a blog page where you can see it in 10 to 11 picture - BLOG PAGE - WARNING:CONTAINS ADULT CONTENT!
If anyone know how to solve this, tell please :)
Thanks in advance
Upvotes: 0
Views: 1024
Reputation: 2377
Try this:
$(document).ready(function(){
$(document).on('mouseover', 'img.photo', function() {
$(this).fadeTo('slow', .5);
});
$(document).on('mouseout', 'img.photo', function() {
$(this).fadeTo('slow', 1);
});
});
Upvotes: 1