Thats not what I wanted, I wanted to make the link show a hidden div. And once the div is shown, it should change the link to hide the div again once its clicked. but hiding/showing it with the hide & show animation.
On Aug 25, 12:24 am, marksimon <zen...@gmail.com> wrote: > $(function(){ > $('a.show').toggle( > var $id=$(this).element('id'); > function(){ > $('#"+$id).removeClass('hide'); > > }, > function(){ > $('#"+$id).addClass('hide'); > > } > ); > > }); > > Not exactly sure if that's what your trying to do. But this should > show/hide a div with the same id as the link id on the click event. > You will also need a css class of .hide { display:none; } > > On Aug 24, 2:37 pm, StefanCandan <onlyo...@live.nl> wrote: > > > Okay, so I'm working on this site, currently I have this jquery code: > > > $("a.show").click(function(event){ > > $("a.show[id="+this.id+"]").removeClass("show") > > $("a[id="+this.id+"]").addClass("hide") > > $("div[title!="+this.id+"][class=news]").hide(500) > > $("div[title="+this.id+"][class=news]").show(500) > > event.preventDefault(); > > }); > > > it doesn't seem to remove the show class, and add the hide class.