[jQuery] Re: How do i remove an event?

2007-05-29 Thread [EMAIL PROTECTED]
Thanks Erik, But how do i rebind something which has been unbound? Erik Beeson wrote: How about: $('div#topLineHover').one('mouseover', function() { $('#topLine').slideDown('slow'); }); Or: $('div#topLineHover').bind('mouseover', function() {

[jQuery] Re: How do i remove an event?

2007-05-29 Thread [EMAIL PROTECTED]
Does that mean i have to repeat the code or is there a way to do it without? Gordon wrote: The same way you bound it in the first place. On May 29, 8:12 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Erik, But how do i rebind something which has been unbound? Erik Beeson wrote:

[jQuery] Re: How do i remove an event?

2007-05-29 Thread Gordon
Yeah, you have to repeat the code. You could put the code in a function though. function doSlide () { $('#myLine').slideDown ('slow'); } $('div#topLineHover').bind('mouseover', doSlide); On May 29, 11:03 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Does that mean i have to repeat the

[jQuery] Re: How do i remove an event?

2007-05-29 Thread Erik Beeson
Alternatively, instead of unbinding the event, you could have your event handler check for some condition: $('div#topLineHover').bind('mouseover', function() { if($('#topLine').is(':hidden')) { $('#topLine').slideDown('slow'); } }); Also, when selecting by ID, no need to specify

[jQuery] Re: How do i remove an event?

2007-05-28 Thread Erik Beeson
How about: $('div#topLineHover').one('mouseover', function() { $('#topLine').slideDown('slow'); }); Or: $('div#topLineHover').bind('mouseover', function() { $('#topLine').slideDown('slow'); }); And: $('div#topLineHover').unbind('mouseover'); --Erik On 5/28/07, [EMAIL