0

My homepage has images in my posts and I have been using the following javascript according to this site (http://grepable.blogspot.sg/2013/01/modify-homepage-image-animation-in.html) to make my images fade out when I mouse over them and fade in when I move my mouse away:

<script type='text/javascript'>
$(function() {
$('.snips-image').hover(function() {
    $(this).find('img').animate({
        opacity: 0
    }, {    
        queue: false,
        duration: 400
    });
}, function() {
    $(this).find('img').animate({
        top: '0px',
        opacity: 1
    }, {
        queue: false,
        duration: 400
    });
});
})
</script>

It has always worked fine, but today I noticed that the javascript isn't working anymore and the animation is gone; the images are just static when I mouse over them. They look like this now (http:// mermaidwithabook .blogspot. com/ <--- please delete the spaces in between). How do I get the javascript to work like it did before? I don't know what went wrong. The images should fade out when you mouse over them just like on this site (http://grepable.blogspot.com/).

Help is greatly appreciated. Thank you!

Sirène
  • 23
  • 1
  • 5
  • Why you want to do with jQuery when you can achieve that with [pure css](http://stackoverflow.com/questions/16344354/how-to-make-blinking-flashing-text-with-css3/16344389#16344389) ? – Mr. Alien Sep 17 '14 at 06:54
  • There are syntax errors in your javascript. If it can't parse, nothing will run. Using firefox, look in the developer tools tab (perhaps Inspector) and you will see the errors - currently unclosed parans. Fix that, and I'm betting your mouse fade will work again too! – BadZen Sep 17 '14 at 06:58
  • Your script above has no errors! It works on my system and on your page, but `only if it is included there!` – Martin Ernst Sep 17 '14 at 13:43
  • Under the couple of dozen scripts in the `` of your page there is a line ` – Martin Ernst Sep 17 '14 at 15:50
  • @MartinErnst You're a lifesaver! That totally worked. Thank you so, so much. – Sirène Sep 17 '14 at 16:39

0 Answers0