【轉】Jquery摺疊效果

來源:互聯網
上載者:User

標籤:style   class   blog   code   java   http   

轉自:http://www.cnblogs.com/clc2008/archive/2011/10/25/2223254.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>    <title></title>    <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>    <style type="text/css">    #myul{ width:504px;}    #myul li { list-style:none;border:1px solid #96C2F1; padding:1px;}    #myul li span{ list-style:none; background:#B2D3F5; width:480px; height:20px; display:block; padding-left:20px;  }    #myul li span.hand{ cursor:pointer;background:#B2D3F5 url(img/right.gif) no-repeat 5px center;}    #myul li span.current{ background:#b2d300 url(img/down.gif) no-repeat 5px center; }    #myul li div{ background:#EFF7FF;width:490px; padding:0px 5px 5px 5px; }          </style>    <script type="text/javascript">        $(function () {            $("#myul li div").hide();             $("#myul li span").addClass("hand");             $("#myul li span").click(function () {                $(this).toggleClass("current");                $(this).parent().siblings().find("span").removeClass("current");                $(this).parent().find("div.hid").slideToggle("fast");                $(this).parent().siblings().find("div").slideUp("fast");                           });        })    </script></head><body><ul id="myul"><li><span>第一級菜單</span>   <div class="hid">     <p>武器哦的撒旦法發生的撒旦法打撒旦法 <br />asdfasfdasfd</p>     <p>武器哦的撒旦法發生的撒旦法打撒旦法 <br />asdfasfdasfd</p>   </div></li><li><span>第二級菜單</span>   <div class="hid">武器哦的撒旦法發生的撒旦法</div> </li><li><span> 第三級菜單</span><div class="hid">   <p>武器哦的撒旦法發生的撒旦法打撒旦法asdfasfdasfd</p>   <p>武器哦的撒旦法發生的撒旦法打撒旦法 <br />asdfasfdasfd</p>   <p>武器哦的撒旦法發生的撒旦法打撒旦法asdfasfdasfd</p>   <p>武器哦的撒旦法發生的撒旦法打撒旦法 <br />asdfasfdasfd</p>   </div></li></ul></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.