Can anyone help me to understand why the reveal button here is not doing it’s job and revealing everything?
Also, if you have a better suggestion for a method to hide / reveal all but a few elements that would appreciated
My JSFiddle example is much easier to understand… http://jsfiddle.net/qp7HB/
$('#hide').click(function(){
$('body > :not(#reveal)').not(this).hide();
$("#test1").add(this).appendTo("body");
});
$('#reveal').click(function(){
$('body').show();
});
Because
bodywas never hidden, only its children. Showing the parent of an element does not automatically show the element itself if it has been hidden explicitly. You can do:DEMO