[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread marksimon
Untitled Document .hide { display:none; } $(function(){ $('a.show').toggle( function(){ var $id=$(this).attr('href'); $('#'+$id).removeClass('hide'); } ,

[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread StefanCandan
Got it working, with the animation too. $(function(){ $('a.show').toggle( function(){ var $id=$(this).attr('href'); $('#'+$id).show(500); } , function

[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread StefanCandan
I have tried the exact same setup as yours, but it did not work. On Aug 25, 12:14 am, James wrote: > Have you tried something like: > >           $("a.show").click(function(event){ >                 $(this).removeClass("show").addClass("hide"); >                 $("div[title!="+this.id+"][class=

[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread StefanCandan
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 wrote: > $(function(){ >         $('a.show').tog

[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread marksimon
$(function(){ $('a.show').toggle( var $id=$(this).element('id'); function(){ $('#"+$id).removeClass('hide'); }, function(){ $('#"+$id).addClass('hide');

[jQuery] Re: How to make it remove class show, and add class hide.

2009-08-24 Thread James
Have you tried something like: $("a.show").click(function(event){ $(this).removeClass("show").addClass("hide"); $("div[title!="+this.id+"][class=news]").hide(500); $("div[title="+this.id+"][class=news]").show(500); event.pr