function foo(){
alert('hello');
}
foo(); // -> alerts 'hello' immediately
foo.delay(5); // alerts 'hello' in 5 seconds
That's the basics for delay. Since you're trying to use 'this' to
invoke the method, you need to bind it (sorry, I should have mentioned
this in the earlier reply)...
var Foo = {
bar: function(){ alert('hello'); },
hello: function(){ this.bar.bind(this).delay(5); }
};
-justin
On Thu, Apr 24, 2008 at 11:16 AM, Geuintoo <[EMAIL PROTECTED]> wrote:
>
>
>
> > to call delay on the invoked function.. no go. Try:
> >
> > this.hideNavi.delay(5)
>
> Nothing happens.
> No Error and the method hideNavi() woun't be called.
>
> Any idea?
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---