首頁  >  文章  >  web前端  >  jQuery做出垂直半透明手風琴效果

jQuery做出垂直半透明手風琴效果

php中世界最好的语言
php中世界最好的语言原創
2018-04-25 11:38:511721瀏覽

這次帶給大家jQuery做出垂直半透明手風琴效果,jQuery做出垂直半透明手風琴效果的注意事項有哪些,下面就是實戰案例,一起來看一下。

運行效果圖:

為大家分享的jQuery半透明抽屜式手風琴程式碼如下

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery半透明抽屉式手风琴代码</title>
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;text-decoration:none;}
body{font:12px/180% Arial, Helvetica, sans-serif, "新宋体";}
.pic{width:1100px;height:430px;margin:70px auto 0;}
.pic ul li{list-style:none;width:100px;height:429px;float:left;}
.pic .l1{background-image:url(img/1.jpg);}
.pic .l2{background-image:url(img/2.jpg);}
.pic .l3{background-image:url(img/3.jpg);}
.pic .l4{background-image:url(img/4.jpg);width:789px;}
.txt{width:100px; height:429px;background:#000;filter:alpha(opacity=50);background:rgba(0,0,0,.5);}
.txt p{color:#fff;font-family:"微软雅黑";float:left;position:relative;}
.txt .p1{font-size:12px;width:12px;margin:25px 25px 0 20px;}
.txt .p2{font-size:14px;width:14px;margin-top:25px;}
</style>
</head>
<body>
<p class="pic">
 <ul>
 <li class="l1">
  <a href="http://www.php.cn" target="_blank">
  <p class="txt">
   <p class="p1">作者 : 走天涯</p>
   <p class="p2">我的个人拉萨之旅||故事之城</p>
  </p>
  </a>
 </li>
 <li class="l2">
  <a href="http://www.php.cn" target="_blank">
  <p class="txt">
   <p class="p1">作者 : 走天涯</p>
   <p class="p2">我的个人拉萨之旅||故事之城</p>
  </p>
  </a>
 </li>
 <li class="l3"> 
  <a href="http://www.php.cn" target="_blank">
  <p class="txt">
   <p class="p1">作者 : 走天涯</p>
   <p class="p2">我的个人拉萨之旅||故事之城</p>
  </p>
  </a>
 </li>
 <li class="l4">     
  <a href="http://www.php.cn" target="_blank">
  <p class="txt">
   <p class="p1">作者 : 走天涯</p>
   <p class="p2">我的个人拉萨之旅||故事之城</p>
  </p>
  </a>
 </li>
 </ul>
</p>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(".pic ul li").hover(function(){
 $(this).stop(true).animate({width:"789px"},500).siblings().stop(true).animate({width:"100px"},500);
});
</script>
</body>
</html>

相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!

推薦閱讀:

Jquery實作開啟頁面隨機選擇切換

#jQuery做出響應式圖片輪播效果

以上是jQuery做出垂直半透明手風琴效果的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn