jquery div swap
How can I make it so when you click the 2nd time it will go back? I guess I gotta somehow find the active one but not sure.
开发者_开发技巧$("#test").click(function(){
$("#dsa").fadeOut()
$("#asd").fadeIn()
});
You looking for something like toggle() ?
Just use .toggle()
:
$("#test").click(function(){
$("#dsa, #asd").toggle(400);
});
精彩评论