0

I have index page. On 404 page I inserted index page through the iframe. For timer i use the code below:

 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);
    })

This code works fine on the index page but on iframe - methods._next is doubled, and if I try hover and unhover - timer is not deleting, but multiplicate. How to resolve that? Thanks

UPD: resolved

4

1 回答 1

0

在第二个回调中更改this.timer为。timerhover()'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);
 });
于 2013-08-05T13:19:10.060 回答