开发者

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);
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜