JQuery實現下拉麪板

  1.   <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4. <title>Simple Slide Panel</title>
  5. <script type="text/javascript" src="jquery.js"></script>
  6. <script type="text/javascript">
  7. $(document).ready(function(){
  8.  $(".btn-slide").click(function(){
  9.   $("#panel").slideToggle("slow");
  10.   $(this).toggleClass("active"); return false;
  11.  });
  12.   
  13. });
  14. </script>
  15. <style type="text/css">
  16. body {
  17.  margin: 0 auto;
  18.  padding: 0;
  19.  width: 570px;
  20.  font: 75%/120% Arial, Helvetica, sans-serif;
  21. }
  22. a:focus {
  23.  outline: none;
  24. }
  25. #panel {
  26.  background: #754c24;
  27.  height: 200px;
  28.  display: none;
  29. }
  30. .slide {
  31.  margin: 0;
  32.  padding: 1;
  33.  border-top: solid 4px #422410;
  34.  background: url(images/btn-slide.gif) no-repeat center top;
  35. }
  36. .btn-slide {
  37.  background: url(images/white-arrow.gif) no-repeat right -50px;
  38.  text-align: center;
  39.  width: 144px;
  40.  height: 31px;
  41.  padding: 10px 10px 0 0;
  42.  margin: 0 auto;
  43.  display: block;
  44.  font: bold 120%/100% Arial, Helvetica, sans-serif;
  45.  color: #fff;
  46.  text-decoration: none;
  47. }
  48. .active {
  49.  background-position: right 12px;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <div id="panel">
  55.  <!-- you can put content here -->
  56. </div>
  57. <p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p>
  58. </body>
  59. </html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章