国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery Effects - Hide and Show

hide() and show()

With jQuery, you can use the hide() and show() methods to hide and show HTML elements:

Syntax:

$(selector).hide(speed,callback);

$(selector).show(speed,callback);

The optional speed parameter specifies hiding / Display speed, which can take the following values: "slow", "fast" or milliseconds.

The optional callback parameter is the name of the function to be executed after hiding or displaying is completed.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").hide(1000);
  });
});
</script>
</head>
<body>
<button>隱藏</button>
<p>這是第一個(gè)</p>
<p>這是第二個(gè)</p>
</body>
</html>

jQuery toggle()

With jQuery, you can use the toggle() method to toggle the hide() and show() methods.

Show hidden elements and hide displayed elements:

Syntax:

$(selector).toggle(speed,callback);

The optional speed parameter specifies the speed of hiding/showing, which can take the following values: "slow", "fast" or milliseconds.

The optional callback parameter is the name of the function executed after the toggle() method is completed.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").toggle();
  });
});
</script>
</head>
<body>
  <button>隱藏/顯示</button>
  <p>點(diǎn)擊一次隱藏</p>
  <p>再點(diǎn)擊一次顯示</p>
</body>
</html>


Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <style type="text/css"> .big{ font-size:30px; color:#FF0000;} </style> </head> <body> <script> $(function(){ $('#click_event').click(function(){ $('#click_event').html(''); if($('#hidden_enent').is(':hidden')) { $('#hidden_enent').show(); $('#click_event').html('隱藏'); } else { $('#hidden_enent').hide(); $('#click_event').html('顯示'); } }) }) </script> <div id="click_event" style="cursor:pointer">隱藏</div> <div id="hidden_enent">測試隱藏</div> </body> </html>
submitReset Code