jQuery效果-滑動

來源:互聯網
上載者:User

標籤:

index.html

 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Insert title here</title> 6    <script src="jquery-3.1.0.min.js"></script> 7    <script src="myjs3.js"></script> 8    <style> 9       #content,#flipshow,#fliphide,#fliptoggle{10          padding:5px;11          text-align:center;12          background-color: #ece023;13          border:solid 1px #ece999;14       }15       #content{16          padding:50px;17          display:none;18       }19    </style>20 </head>21 <body>22     23     <div id="flipshow">出現</div><!-- 點擊滑動出現 -->24     <div id="fliphide">隱藏</div><!-- 點擊滑動隱藏 -->25     <div id="fliptoggle">隱藏/出現</div><!-- 點擊滑動隱藏/出現 -->26     <div id="content">Hello world</div>27     28 </body>29 </html>

 

js代碼:

 1 $(document).ready(function(){ 2     $("#flipshow").click(function(){//點擊滑動出現 3         $("#content").slideDown(1000); 4     }); 5      6     $("#fliphide").click(function(){//點擊滑動隱藏 7         $("#content").slideUp(1000); 8     }); 9     10     $("#fliptoggle").click(function(){//點擊滑動隱藏/出現11         $("#content").slideToggle(1000);12     });13 });

 

jQuery效果-滑動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.