开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜