亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

實例講解Jquery中隱藏hide、顯示show、切換toggle的用法

 更新時間:2016年05月13日 16:53:06   作者:yenga  
這篇文章主要介紹了實例講解Jquery中隱藏hide、顯示show、切換toggle的用法,感興趣的小伙伴們可以參考一下

本文實例為大家分享了jquery中show()、hide()和toggle()用法實例,供大家參考,具體內(nèi)容如下

<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
 <title>初識jQuery</title> 
<script src="http:/chabaoo.cn/jquery/1.9.0/jquery.js" type="text/javascript"></script> 
<!--引用這個jquery庫--> 
 
<style> 
#test{ 
  display:none; 
  width:120px; 
  height:50px; 
  border:1px solid blue; 
   } 
</style> 
</head> 
   
  <body> 
    <div id="test">Hello world!</div> 
    <!--設(shè)置三個按鈕,每次點擊調(diào)用特定的函數(shù)--> 
    <button onclick="sayHello()">點我打開!</button> 
    <button onclick="sayGoodbye()">點我關(guān)閉!</button> 
    <button onclick="change()">點我切換!</button> 
     
    <script type="text/javascript"> 
      function sayHello(){ 
        $("#test").show(5000); 
      <!--設(shè)參數(shù)5000,表示用5000ms的時間完成這個動作-->  
      } 
       
       function sayGoodbye(){ 
        $("#test").hide(); 
      <!--不設(shè)置,默認速度--> 
      } 
       
       function change(){ 
        $("#test").toggle("slow"); 
      <!--設(shè)置以slow的速度打開--> 
      } 
    </script> 
  </body> 
</html> 

效果圖:

以上就是本文的全部內(nèi)容,希望對大家學習jquery程序設(shè)計有所幫助。

相關(guān)文章

最新評論