try this:

var fooBar = *new* Class({****

    popit : *function* () {****

        alert("hello")****

        }****

    })****

fooInt = *new* fooBar()****

var timer = fooInt.popit.delay(5000, fooInt);****

clearTimeout(timer);****

so basically make sure that the context (this) is correct in the method,
this can be passed as second argument in the delay method.
delay (and periodical / setTimeout / setInterval) returns a timeoutID that
you can use in the clearTimeout / clearInterval.

On Sun, Jul 3, 2011 at 6:04 PM, Steve Onnis <[email protected]> wrote:

> Could someone tell me if this is a javascript thing or a mootools issue***
> *
>
> ** **
>
> When you create a new Class() and then try to call a method on the class
> with function.delay() and then try to stop that delay the function still
> runs.****
>
> ** **
>
> For example****
>
> ** **
>
> fooBar = *new* Class({****
>
>     popit : *function* () {****
>
>         alert("hello")****
>
>         }****
>
>     })****
>
> fooInt = *new* fooBar()****
>
> fooInt.popit.delay(5000);****
>
> clearTimeout(fooInt)****
>
> ** **
>
> Even though the clearTimeout() is called for the delay the function still
> runs.****
>
> ** **
>
> Any ideas?****
>
> ** **
>
> Steve****
>

Reply via email to