JQuery Animate only runs once

I am trying to make all the divs that are of the .to-be-hidden css class to fade AND the div with id="feat-hover" to become fully visible when I hover over div id="mission". Here is my code: $(function() { $("#mission").hover(function () { $(".to-be-hidden").stop().animate({opacity: 0.5}, "slow"); $('#feat-hover').stop().animate({'opacity': '1.0'}, "slow"); }, function () { $(".to-be-hidden").stop().animate({opacity: 1.0}, "slow"); $('#feat-hover').stop().animate({'opacity': '0'}, "slow"); }); }); Here is my HTML: I replaced the blocks of text with want this to fade. The scripts runs correctly when I hover for the first time and then it doesn't run again. Please help!
Is it possible to have a fidlle with the problem?

以上就是JQuery Animate only runs once的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准