Home  >  Article  >  Web Front-end  >  jQuery creates vertical translucent accordion effect

jQuery creates vertical translucent accordion effect

php中世界最好的语言
php中世界最好的语言Original
2018-04-25 11:38:511720browse

This time I will bring you jQuery to create a vertical translucent accordion effect. What are the precautions for jQuery to create a vertical translucent accordion effect? ​​The following is a practical case, let's take a look.

Running renderings:

The jQuery translucent drawer accordion code shared with you is as follows

<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>
I believe you will read the case in this article You have mastered the method. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Jquery implements random selection switching when opening the page

jQuery creates a responsive image carousel effect

The above is the detailed content of jQuery creates vertical translucent accordion effect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn