成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? jquery實現手風琴效果
全站頭部文字 我要出現在這里
jquery實現手風琴效果 658 2024-03-20   

本文實例講述了jquery實現手風琴效果的代碼。分享給大家供大家參考。具體如下:

效果過程就是當鼠標覆蓋圖片時,這張圖片的寬度變大,其他兄弟圖片寬度變小,效果如下:

查看圖片

具體代碼如下

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>jQuery橫向手風琴圖片展示動畫DEMO演示</title>
<link  type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="http://www.gimoo.net/t/1904/js/jquery.min.js"></script>
</head>
<body>
<手風琴效果-->
<div class="flash4">
<ul>
<li class="first">
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img1.jpg" width="538" height="405" alt=""class="tm"/></div>
<div class="imgCen">給你15分鐘做“對”的時尚人</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li>
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img2.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">蒂芙尼為你吟唱一曲自然頌</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li>
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img3.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">瑞麗·妝線上精品輕雜志</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li>
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img4.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">《ar》劉海造型女孩只需這樣即刻煥然一新</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li>
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img5.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">電影×大明星見證傳奇從戛納誕生</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li>
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img6.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">重返20歲試用周</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
<li class="last">
<div class="imgTop"><img src="http://www.gimoo.net/t/1904/images/ruili_img7.jpg" width="538" height="405" alt=""/></div>
<div class="imgCen">玩美女孩蓋天天陽光女神進階攻略</div>
<div class="imgBot"><a ><p class="bt_1">服飾</p><p class="bt_2"><span>封面明星故事</span><span>2015春夏趨勢</span><span>我愛海淘</span></p></a></div>
</li>
</ul>
</div>
<手風琴結束-->
<script src="http://www.gimoo.net/t/1904/js/script.js" type="text/javascript"></script>
<div style="text-align:center;clear:both;">
</div>
</body>
</html>

CSS代碼:

@charset"utf-8";
*{margin:0px;padding:0px;font-family:"微軟雅黑";font-size:12px; text-decoration:none;list-style-type:none;}
img{border:0px;}
/*開始*/
.flash4{width:1180px;height:450px;margin:0pxauto;margin-bottom:20px;position:relative;}
.flash4 ul li{width:106px;height:450px;border-left:1px solid #000;position:relative;overflow:hidden;float:left;}
.flash4 ul li .imgTop img{opacity:0.4;}
.flash4 ul li .imgTop img.tm{opacity:1;}
.flash4 ul li .imgCon{width:538px;height:405px;}
.flash4 ul li .imgCen{width:538px;height:50px;background:rgba(0,0,0,0.5);color:#fff;font-size:20px;line-height:50px;position:absolute;left:0px;bottom:45px;text-indent:20px;display:none;}
.flash4 ul li .imgBot{width:538px;height:45px;background:#222;}
.flash4 ul li .imgBot p.bt_1{width:80px;line-height:45px;font-size:16px;color:#fff;text-indent:20px;float:left;}
.flash4 ul li .imgBot p.bt_2{width:458px;height:45px;line-height:45px;float:left;display:none;}
.flash4 ul li .imgBot p.bt_2 span{font-size:14px;color:#fff;padding-right:30px;background:url(../images/part2_icon.png)no-repeat left center;padding-left:10px;}
.flash4 ul li.first{width:538px;}
.flash4 ul li.last{position:absolute;right:0px;bottom:0px;}

jQuery代碼:

//手風琴動畫效果
var index7 =0;//定義變量,賦值為0;
$(".flash4 ul li").mouseenter(function(){
index7 = $(this).index();
$(this).stop().animate({
width:538
},500).siblings("li").stop().animate({
width:106
},500);
$(".imgCen").eq(index7).css("display","block").siblings(".imgCen").css("display","none");
$("p.bt_2").eq(index7).css("display","block").siblings("p.bt_2").css("display","none");
$(".imgTop img").eq(index7).addClass("tm").siblings(".imgTop img").removeClass("tm");
});
$(".flash4 ul li").mouseleave(function(){
$(this).eq(index7).stop().animate({
width:538
},500);
$(".imgCen").css("display","none");
$("p.bt_2").css("display","none");
});

源碼下載:jquery實現手風琴效果

希望大家會喜歡分享的jquery手風琴效果。



主站蜘蛛池模板: 六年级下册语文书50页内容| 料音| 皮皮电影| 韩国成人网| 大幻术师| 成人的性行为免费| 未来警察| 电影《大突围》完整版| 金首露| 我被最想被拥抱的人威胁了| 美丽的日子 电视剧| 光明力量2古代封印攻略| 三年片大全电影| 卫平| 北京卫视节目单今天| 浪人电影在线观看完整版免费| ()目()身的词语| 蒋昌义| 陈妍希三级露全乳电影| 姐妹姐妹演员全部演员表| 2023中国十大廉洁人物事迹| 黄网站在线免费| 敦煌夜谭国语电影在线观看高清免费 | 公交车上的那些事| 视频爱爱| 《最后的凶手》免费观看| 张成楚| 新红楼梦电影| 水管十大品牌排行榜前十名| cctv6 节目表| 小姐与流氓| 黄色网址视频| 妻子的电视剧| 玉林电视台| 王渝萱的电影| 免费头像图片| 欲望旅馆| gaysex双巨巴| 免费头像图片| 红电视剧演员表| 《哪吒3》免费全部观看|

!!!站長長期在線接!!!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103