Hy This works in my Class: this.hideNavi(); I tried: this.hideNavi().delay(5000); // -> Error: this.hideNavi() has no properties I tried: this.hideNavi().bind(this).delay(5000); // -> Error: this.hideNavi() has no properties How can I fix? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Apr 24, 2008 at 10:54 AM, Geuintoo <drummerbase-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> this.hideNavi().delay(5000); > this.hideNavi().bind(this).delay(5000);Yes, those won''t work. You are invoking the function and then trying to call delay on the invoked function.. no go. Try: this.hideNavi.delay(5) Note the lack of parenthesis on your function name (we don''t want to invoke it). Also note that the parameter you pass to the delay method is in SECONDS, not milliseconds. -justin --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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
<drummerbase-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Perfect! Great, thanks a lot! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---