小编vin*_*nod的帖子

淡入淡出效果会在我悬停时重复多次

当我将鼠标悬停在它们上方时,我正在使用淡入淡出效果来隐藏和显示两个div.唯一的问题是,当我将鼠标悬停在它上面时动画会重复多次,即使这是偶然的,也有点烦人.

我使用.stop(true,false)方法进行动画制作.

像这样:

$('.fallInspiration').hover(
   function(){
      $(this).stop(true, false).animate({color: '#D55E8E'}, 300);
},
Run Code Online (Sandbox Code Playgroud)

但是我不知道在使用淡入淡出效果时如何解决问题.

这是我正在使用的代码:

$('.thisWeekWrap').hover(
    function()
    {
        $('.thisWeek').fadeOut(400);
        $('.thisWeekHover').fadeIn(400);
    },
    function()
    {
        $('.thisWeek').fadeIn(400);
        $('.thisWeekHover').fadeOut(400);
    }
);
Run Code Online (Sandbox Code Playgroud)

非常感谢帮助.谢谢

html jquery animation fade repeat

2
推荐指数
1
解决办法
5533
查看次数

标签 统计

animation ×1

fade ×1

html ×1

jquery ×1

repeat ×1