如何取消绑定iframe中的第二个滑块效果

时间:2013-08-05 13:00:54

标签: javascript jquery

我有索引页面。在404页面上,我通过iframe插入了索引页面。对于计时器我使用以下代码:

 var timer = setInterval(function () {methods._next(data,options)},3000);

 $("#centralPanelBorder, #leftBlock, #rightBlock").hover(function () {
    clearInterval(timer);
 },
 function () {        
       timer = setInterval(function () {methods._next(data, options)},3000);
    })

此代码在索引页面上工作正常,但在iframe上 - methods._next加倍,如果我尝试悬停和取消 - 定时器不是删除,而是多重。怎么解决?感谢

UPD:已解决

1 个答案:

答案 0 :(得分:0)

this.timer次回拨中将timer更改为hover()'s

var timer = setInterval(function () {methods._next(data,options)},3000);

 $("#centralPanelBorder, #leftBlock, #rightBlock").hover(function () {
    clearInterval(timer);
 },
 function () {        
    timer = setInterval(function () {methods._next(data, options)},3000);
 });