Bringing a div back from .hide or .fadeOut onclick
Okay, so this is the example HTML.
<a href="http://www.google.com/">
<div id="link">
This is a link
</di开发者_如何学Gov>
</a>
<div class="example">
Example div 1
</div>
<div class="example">
Example div 2
</div>
<div class="example">
Example div 3
</div>
Whenever #link is clicked, all the divs with the class .example are hidden.
$("#link").click(function ( event ) {
$(".example").hide();
});
or
$("#link").click(function ( event ) {
$(".example").fadeOut("fast");
});
Now whenever any spot on the page is clicked, all of the .example divs return.
Is it possible? It doesn't all necessarily have to be done with jQuery.
Thanks in advance.$('body').live('click', function() {
$(".example").show();
});
精彩评论