[jQuery] Re: Problem with togle()

2007-04-04 Thread Sebastián V . Würtz
function(){$(rel).animate({opacity: 'show'}, "slow", "easein"); }); }); Again, sorry for the google english translated :) - Original Message ----- From: "Joel Birch" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 04, 2007 1:36 PM Subject:

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
On 05/04/2007, at 1:04 AM, Sebastián V. Würtz wrote: Now hide the link that should hide the "news", so still donst work :) I send a pic for example I set up a quick demo page so I can try and see why your links are now hiding when you click them. However, my demo page seems to behave how

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
Whoops - too many curly brackets in the toggle there. Correct code here: $(".toggle_cat a").each(function(i){ $(this).attr("title", "Click here to exclude this cat"); $(this).click(function(event){ $(this).toggleClass("selected"); }); var rel = thi

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
What about this (using your coding style to avoid confusion): $(".toggle_cat a").each(function(i){ $(this).attr("title", "Click here to exclude this cat"); $(this).click(function(event){ $(this).toggleClass("selected"); }); var rel = this.rel;

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
#x27; for use in the toggle */ $("." + this.rel).toggle( function() { $("." + self.rel).hide('slow'); }, function() { $("." + self.rel).show('fast'); } ); }); }); - Original Message - From: "Joel Birch" <[EMAIL PRO

[jQuery] Re: Problem with togle()

2007-04-04 Thread Sebastián V . Würtz
slow'); }, function() { $("." + self.rel).show('fast'); } ); }); }); - Original Message - From: "Joel Birch" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 04, 2007 9:28 AM Subject: [jQuery] Re: Problem with togle() ...and optimised

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
...and optimised further to reduce redundant jquery object creation and property look-ups: $(".toggle_cat a").each(function(){ $(this) .attr("title", "Click here to exclude this cat") .click(function(){ $(this).toggleClass("selected"); v

[jQuery] Re: Problem with togle()

2007-04-04 Thread Joel Birch
I guess that inside the anonymous functions within toggle, 'this' is no longer the 'this' that you intend it to be. Try setting a variable to the 'this' you want outside of the toggle instead - like so: $(".toggle_cat a").each(function(i){ $(this).attr("title", "Click here to exclude thi