jQuery学习之手风琴效果
来源:互联网 发布:知其所以然技术论坛 编辑:程序博客网 时间:2024/06/06 12:20
js代码:
<script type="text/javascript" src="jquery-3.0.0.js"></script>
<script type="text/javascript"> $(function() { //获取所有li遍历 $(".li_list").each(function() { //当鼠标进去当前li $(this).mouseenter(function() { //设置当前元素宽度 $(this).stop() .animate({ "width": "600px" }, 500, "linear"); //设置同胞元素宽度 .siblings().stop() .animate({ "width": "100px" }, 500, "linear"); }); }); }); </script>
css代码:
.li_list { width: 100px; height: 300px; list-style: none; float: left; overflow: hidden; } .li_list img { width: 100%; height: 100%; } .divbg { width: 600px; height: 300px; background: rgba(230, 0, 0, 0.5); text-align: center; line-height: 300px; float: left; } .divbg span { display: block; width: 100px; height: 300px; float: left; } .div1 { width: 500px; height: 300px; float: left; } .mo{ width: 600px; }
html代码:
<ul class="ul_list"> <li class="li_list"> <div class="divbg"> <span>萌宠</span> <div class="div1"> <img src="img/0.jpg" /> </div> </div> </li> <li class="li_list"> <div class="divbg"> <span>萌宠</span> <div class="div1"> <img src="img/1.jpg" /> </div> </div> </li> <li class="li_list"> <div class="divbg"> <span>萌宠</span> <div class="div1"> <img src="img/2.jpg" /> </div> </div> </li> <li class="li_list mo"> <div class="divbg"> <span>萌宠</span> <div class="div1"> <img src="img/3.jpg" /> </div> </div> </li> </ul>
阅读全文
0 0
- jQuery学习之手风琴效果
- Jquery学习之旅之Jquey滑动实现手风琴效果
- jQuery手风琴效果
- jquery实现手风琴效果
- jquery手风琴效果插件
- jquery插件手风琴效果
- jquery插件-手风琴效果
- jquery插件手风琴效果
- jquery简单手风琴效果
- jQuery手风琴效果
- jquery手风琴效果
- jquery实现手风琴效果
- jquery手风琴效果
- jQuery实现手风琴效果
- 强大的jQuery UI——学习手风琴效果
- jquery ui 手风琴效果集锦
- Jquery UI插件---手风琴效果
- 使用jQuery实现手风琴效果
- uC/OS-II系统学习笔记(3)——实时操作系统概念下篇
- css3 布局方式
- c++模板
- ES6 变量声明与赋值:值传递、浅拷贝与深拷贝
- PHP入门(第七弹:运算符)
- jQuery学习之手风琴效果
- [LintCode]69.二叉树的层次遍历
- 线程的概念和多线程模型
- Java基础——数组
- Bootstrap css学习笔记(四)——图片与辅助类
- POJ2137:Cowties(dp)
- 使用xtrabackup工具套件不停机搭建mysql主从
- 用jdbc连接mysql,编写DTO类,DAO接口,DAOImpl实现
- Windows PowerShell 实战指南-动手实验-15.11