开发者

jquery div swap

开发者 https://www.devze.com 2023-02-20 07:36 出处:网络
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.开发者_开发技巧

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

精彩评论

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