jquery實現的下拉和收縮代碼執行個體

來源:互聯網
上載者:User

標籤:style   blog   http   java   color   strong   

jquery實現的下拉和收縮代碼執行個體:
下拉和收縮類似的效果應用非常的頻繁,本章節簡單介紹一下如何?此效果。
代碼執行個體如下:

<!DOCTYPE html>  <html>  <head>  <meta charset=" utf-8">  <meta name="author" content="http://www.softwhy.com/" /> <head> <title>螞蟻部落</title> <style type="text/css"> body{   margin:0 auto;   padding:0;   width:570px;   font:75%/120% Arial, Helvetica, sans-serif; } a:focus{   outline:none; } #panel{   background:#69C7F7;   height:200px;   display:none; } .slide{   margin:0;   padding:0;   border-top:solid 4px #F27613; } .btn-slide{   background:#F27613 url(mytest/jQuery/20121225165932118.gif) no-repeat right -50px;   text-align:center;   width:144px;   height:31px;   padding:10px 10px 0 0;   margin:0 auto;   display:block;   font:bold 120%/100% Arial, Helvetica, sans-serif;   color:#fff;   text-decoration:none; } .active{   background-position:right 12px; } </style> <script type="text/javascript" src="http://www.softwhy.com/mytest/jQuery/jquery-1.8.3.js"></script> <script type="text/javascript">  $(document).ready(function(){    $(".btn-slide").click(function(){      $("#panel").slideToggle("slow");      $(this).toggleClass("active");      return false;    }) }) </script> </head> <body> <div style="display: block;" id="panel"></div> <p class="slide">   <a href="javascript:;" class="btn-slide active">點擊查看效果</a> </p> </body> </html>

以上代碼實現了下拉和收縮效果,代碼比較簡單,這裡就不多介紹了。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.