2013-08-16 67 views
1

我有一个jQuery的功能,删除内容和切换按钮上twitter引导,并在该按钮切换后,如果你点击它的假设回去的内容,但它不是加工。请帮忙。谢谢!Jquery .show按钮将不起作用

$('#btnAdd').click(function() { 
    $(".RemoveSettings").remove(); 
    $(this).toggleClass('displaying'); 
    $('#removedcontent').show(); 
}); 
$('#removedcontent').click(function() { 
    $('#removedcontent').remove(); 
    $(".RemoveSettings").show(); 
}); 

回答

2

您正在删除元素,如果它们被删除,则无法显示它们。

改为使用hide() s代替remove()

$('#btnAdd').click(function() { 
    $(".RemoveSettings").hide(); 
    $(this).toggleClass('displaying'); 
    $('#removedcontent').show(); 
}); 
$('#removedcontent').click(function() { 
    $('#removedcontent').hide(); 
    $(".RemoveSettings").show(); 
});