jquery应用实例分享_实现手风琴特效
效果:
实例如下所示:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> *{padding: 0px;margin: 0px;} li{ width: 80px;height:300px; float: left;overflow: hidden; list-style: none; } </style> <script type="text/javascript "src="http://code.jquery.com/jquery-1.10.2.min.js"></script> </head> <body> <script > $(function () { $("ul li").mouseover(function (){ $(this).stop().animate({width:350},500)//stop函数:停止当前正在运行的动画 //siblings:遍历 $(this).siblings().stop().animate({width:80},500)//anmate:500ms后将其width变为80px; }) }) </script> <div> <ul> <li style="width: 350px"><img src="1.jpg"></li> <li><img src="2.jpg"></li> <li><img src="3.jpg"></li> <li><img src="4.jpg"></li> <li><img src="5.jpg"></li> </ul> </div> </body> </html>
相关推荐
tztzyzyz 2020-07-05
87281248 2020-07-04
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20