jquery淡入淡出无延迟代码
<!DOCTYPE html> <html> <head> <script src="jquery.js"></script> <script> $(document).ready(function(){ $("#button1").mouseover(function(){ $(".div1").stop().animate({opacity:1},1000); $(".div2").stop().animate({opacity:1},1000); $(".div3").stop().animate({opacity:1},1000); }); $("#button1").mouseleave(function(){ $(".div1").stop().animate({opacity:0},1000); $(".div2").stop().animate({opacity:0},1000); $(".div3").stop().animate({opacity:0},1000); }); }); </script> </head> <body> <button id="button1">鼠标放在这里,使三个矩形淡入</button> <div class="div1" style="width:80px;height:80px;opacity:0;background-color:red;"></div> <br> <div class="div2" style="width:80px;height:80px;opacity:0;background-color:green;"></div> <br> <div class="div3" style="width:80px;height:80px;opacity:0;background-color:blue;"></div> </body> </html>
另外
function () { $(".div1").animate({ 'opacity': 0 },{ queue: false, duration: 1000 }); },
function () { $(".div1").animate({ 'opacity': 1 }, { queue: false, duration: 1000 }); }
也可以。
jquery淡入淡出无延迟代码的更多相关文章
- jQuery淡入淡出轮播图实现
大家好我是 只是个单纯的小白,这是人生第一次写博客,准备写的内容是Jquery淡入淡出轮播图实现,在此之前学习JS写的轮播图效果都感觉不怎么好,学习了jQuery里的淡入淡出效果后又写了一次轮播图效果 ...
- jQuery淡入淡出瀑布流效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- jQuery淡入淡出效果轮播图
用JavaScript做了平滑切换的焦点轮播图之后,用jQuery写了个简单的淡入淡出的轮播图,代码没有做优化,html结构稍微有一些调整,图片部分用ul替换了之前用的div. html结构如下: & ...
- jquery淡入淡出
html代码: <button id="b1" type="button">淡出</button> <button id=&quo ...
- jQuery 淡入淡出
演示 jQuery fadeIn() 方法: <!DOCTYPE html> <html> <head> <meta charset="utf-8& ...
- jQuery淡入淡出效果
如果是通过鼠标点击事件来触发动画效果可以使用 $("#button").click(function(){ $("#div").stop().fadeToggl ...
- jquery淡入淡出轮播图
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- jQuery淡入淡出的轮播图
html结构: <div class="banna"> <ul class="img"> ...
- jQuery 淡入淡出有png图的时候 ie8下有黑色边框
jQuery fadeTo 时ie8 png图片有黑色边框 往带有png图的样式里加 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader ...
随机推荐
- 【mysql】使数据表ID连续的两个方法
经常有一些完美主义者问我,怎么让数据库的自增字段在记录被删除时重置它们的顺序,这里不去讨论这么折腾是否真有必要,只说说解决方法,有这方面需求的朋友不妨看看. 方法1.删除自增字段,然后重建(缺点就是必 ...
- ( 转 ) UML 类图
在UML类图中,常见的有以下几种关系:泛化(Generalization), 实现(Realization),关联(Association),聚合(Aggregation),组合(Compositi ...
- ubuntu下如何查找某个文件的路径
1.whereis 文件名 特点:快速,但是是模糊查找,例如 找 #whereis mysql 它会把mysql,mysql.ini,mysql.*所在的目录都找出来. 2.find / -name ...
- Codeforces 702 D Road to Post Office
题目描述 Vasiliy has a car and he wants to get from home to the post office. The distance which he needs ...
- HDOJ 4961 Boring Sum
Discription Number theory is interesting, while this problem is boring. Here is the problem. Given a ...
- Codeforces 786C Till I Collapse(树状数组+扫描线+倍增)
[题目链接] http://codeforces.com/contest/786/problem/C [题目大意] 给出一个数列,问对于不同的k,将区间划分为几个, 每个区间出现不同元素个数不超过k时 ...
- Java 输入框复用代码
1 int messageType=JOptionPane.INFORMATION_MESSAGE; String message=mines + " minutes is approxim ...
- no such file or directory : 'users/shikx/xxx/xxx/Appirater.m'
删除此处红色的.m文件即可
- ionic 打包成apk后,所有网络请求404
无论怎么改 config.xml <allow-navigation href="http://*/*" /> <allow-intent href=" ...
- 【教训】 form表单提交时,action url中参数无效
今天提交一个表单,内容参考如下: <form action="add.php?a=123&b=456"> <input type="hi ...