有点奇怪的标题,但这是我得到的。
我发现这个问题问了几次,但遮阳篷似乎对我来说不能正常工作
我得到的是一个上下弹跳以吸引您的注意力的页脚,当您将鼠标悬停在它上面时,它会展开并显示一个过滤器。
现在它在窗口中完美运行,但是当我移动到另一个选项卡并返回该站点时,它会依次播放所有弹跳。
我读过一篇文章,当在另一个选项卡中时,chrome 会减慢间隔以提高 cpu 速度。
我现在只在窗口设置为焦点时播放计时器,并在设置为模糊时禁用。但这不是 100% 的时间。
var $bounceInter = 6000;
function mycode() {
if($bounceOn == true) {
$("#footer").animate({bottom:"+=20px"},150, 'swing').animate({bottom:"-=20px"},150, 'swing').animate({bottom:"+=10px"},100, 'swing').animate({bottom:"-=10px"},100,"swing",function(){$("#footer").data("bouncing", false);});
}
clearTimeout($bounceTimer);
$bounceTimer = setTimeout(mycode, $bounceInter); // repeat myself
}
$(window).focus(function() {
$bounceTimer = setTimeout(mycode, $bounceInter);
});
$(window).blur(function() {
clearTimeout($bounceTimer);
});
var $bounceTimer = setTimeout(mycode, $bounceInter);
还有其他可能的修复吗?
我从另一个人那里得到了退回代码,也许问题在那里?