位奇怪的标题,但在这里我得到了什么。时间间隔,在其他时间停止。当返回播放所有的时间间隔之后
我发现这个问题问了几次,但awnsers不似乎正常工作对我来说
我得到的是,反弹向上和向下引起你的注意页脚,当你在它悬停它将展开一个过滤器。
现在它在窗口中完美地工作,但是当我移动到其他选项卡并返回到该网站时,它会在所有弹跳之后发挥彼此作用。
我读过一篇文章,指出在另一个选项卡中减少间隔时间以提高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);
任何其他可能的修复?
我已经从另一个人那里得到反弹代码,也许问题出在那里?
感谢它的工作! 只要页脚展开以使其无法反弹,bounceOn就会设置为false。 –