[jQuery] Re: Help please with toggling a class

2009-02-27 Thread Josh Powell
Without really understanding what your fadeToggle plugin is doing, this will toggle adding and removing a class: $(function() { $('a.aboutlink').toggle( function () { $(this).addClass('aboutBox');

[jQuery] Re: Help please with toggling a class

2009-02-27 Thread Jack Killpatrick
this might help get you down the right path: http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C... - Jack zac wrote: Hi.. I am trying to have it so my navigation toggle hidden boxes on the site. I want it so the link toggles the box on and off, as well as having the link itself have a cl

[jQuery] Re: Help please with toggling a class

2009-02-27 Thread Karl Swedberg
Hi Zac, You just need to add one line -- $(this).toggleClass('yourClass'); -- where "yourClass" is the class you want to toggle on and off. You should also add return false after that line so that the default click behavior doesn't occur. jQuery.fn.fadeToggle = function(speed, easing, cal

[jQuery] Re: Help please with toggling a class

2009-02-27 Thread Josh Powell
oh, very nice. I wasn't aware of toggleClass. On Feb 27, 6:51 pm, Karl Swedberg wrote: > Hi Zac, > > You just need to add one line -- $(this).toggleClass('yourClass'); --   > where "yourClass" is the class you want to toggle on and off. > > You should also add return false after that line so th

[jQuery] Re: Help please with toggling a class

2009-02-28 Thread zac
Great! Thanks!! On Feb 27, 7:09 pm, Josh Powell wrote: > oh, very nice.  I wasn't aware of toggleClass. > > On Feb 27, 6:51 pm, Karl Swedberg wrote: > > > Hi Zac, > > > You just need to add one line -- $(this).toggleClass('yourClass'); --   > > where "yourClass" is the class you want to toggle