jQuery做出手风琴效果
今天学到JQuery中的遍历-siblings,便手痒做了个手风琴的动态效果,有一点收获,分享给大家。mouseout的时候一定要记得opacity必须设置,不然li的opacity会保持mousemove时的状态。代码有不足的地方欢迎大家踊跃的提意见。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>siblings遍历</title>
<style type="text/css">
ul{
overflow: hidden;
}
ul li{
text-align: center;
list-style: none;
float: left;
width: 50px;
height: 100px;
margin: 10px auto;
background: #444444;
border: 0.5px solid #ffffff;
}
</style>
<script type="text/javascript" src="../vendor/jquery-1.11.3.min.js"></script>//引入jQuery
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
</ul>
<script type="text/javascript">
$("ul li").mouseover(function(){
$(this).animate({
opacity:"0.8",
width:"55px",
height:"110px"})
.siblings().css({
opacity:"0.4",
width:"45px",
height:"90px"});
});
$("ul").mouseout(function(){
$("ul li").css({
background:"#444444",
width: "50px",
height: "100px",
opacity:"1",//一定要记得透明度也得设置,如若不设置,透明度会保持你在mousemove的时候的状态
})
});
</script>
</body>
</html>
jQuery做出手风琴效果的更多相关文章
- 基于jquery横向手风琴效果
基于jquery横向手风琴效果是一款基于jquery实现的左右滑动手风琴图片轮播切换特效.效果图如下: 在线预览 源码下载 效果图如下: <div class="flash&quo ...
- jquery横向手风琴效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jquery 图片手风琴效果
这篇主要是手风琴效果和无缝切换相结合,在Demo里的Demo3.html.Demo4.html. 手风琴原理比较简单,当鼠标经过的时候改变图片的路径,鼠标移到另一张图片时还原路径. 虽然原理简单,但是 ...
- jquery横向手风琴效果2
<!doctype html> <html> <head> <meta charset="utf-8"> <script ty ...
- jquery实现手风琴效果
html----accordion.html <!DOCTYPE html> <html lang="en"> <head> <meta ...
- jquery版手风琴效果
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- jQuery实现手机竖直手风琴效果
效果:http://hovertree.com/texiao/jquery/65/ 效果图: 手机扫描二维码查看效果: 代码: <!doctype html> <html lang= ...
- 使用 jQuery & CSS3 实现优雅的手风琴效果
手风琴效果常用于切换显示一组内容,这种方式既可以节省网页空间又可以有动画效果.今天,我们将创造一个优雅的手风琴内容效果.这个想法是有悬停时滑出一些垂直手风琴标签.我们将添加一些 CSS3 属性来提升外 ...
- 基于 jQuery 实现垂直滑动的手风琴效果
今天我们要与大家分享一个漂亮而灵活的垂直 jQuery 手风琴效果.其主要思想是扩大手风琴片上的点击和显示更多的信息.其他内容片段将变得不那么透明.当使用一个导航箭头导航下一个片段,新的片会从顶部或底 ...
随机推荐
- centos samba 服务器的配置和使用
1.安装samba服务 #yum install samba samba-client samba-swat 2.修改配置文件 #vi /etc/samba/smb.conf security = u ...
- 获取exe文件窗口抓图,将memo转化为JPG输出
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...
- bash: /home/aprilpeng/.bashrc: Permission denied
bash: /home/aprilpeng/.bashrc: Permission denied 出现这样的权限问题,一般是在切换用户的时候,用户没有该目录的权限 可以$chown -R git:us ...
- Web Service概念辨析
Web Service包含两个概念. 其一是Web Service标准体系,由SOAP.WSDL.UDDI三要素组成,是平台和语言无关的.在这个概念里和WCF做比较是错误的,因为前者是行业标准,后者是 ...
- sin6_addr打印:string to sockaddr_in6 and sockaddr_in6 to string
函式原型: #include <arpa/inet.h> const char *inet_ntop(int af, const void *src, char *dst, socklen ...
- Data Structure Binary Tree: Convert a given tree to its Sum Tree
http://www.geeksforgeeks.org/convert-a-given-tree-to-sum-tree/ #include <iostream> #include &l ...
- http keep-alive简解
http协议中,客户端发送请求,服务端在接收到请求后,返回所需要的数据后可以关闭连接,这样客户端读取完数据时会返回EOF(-1),表明数据已接受完全 备注:EOF end of file 什么是kee ...
- django-forms表单验证
django生成登录随机图片验证码:http://www.cnblogs.com/wupeiqi/articles/4786251.html def insert(request): # print( ...
- CentOS7 + Python3 + Django(rest_framework) + MySQL + nginx + uwsgi 部署 API 开发环境, 记坑篇
CentOS7 + Python3 + Django(rest_framework) + MySQL + nginx + uwsgi 部署 API 开发环境 CentOS7 + Python3 + D ...
- Ubuntu14 下安装jdk1.8
1.oracle官网下载jdk-8u45-linux-i586.gz 此为32位 2.放在任意目录下,如/home/hongxf 3.直接解压该文件 sudo tar -xvf jdk-8u45-li ...