使用jquery实现图片淡入淡出
来源:互联网 发布:中值滤波算法原理 编辑:程序博客网 时间:2024/06/05 18:18
html部分:
<div id="content"><div id="logo1"><img class="top" id="top" src="jslunbo1/images/logo1.png" /><div id="juzhong"></div></div><div id="logo2"><img class="top2" id="top2" src="jslunbo1/images/logo2.png" /><div id="juzhong2" class="top2"></div></div><div id="logo3"><img class="top3" id="top3" src="jslunbo1/images/logo3.png" /><div id="juzhong3" class="top3"></div></div></div>
css部分:
#logo1{ width: 299px; height: 427px; /*border: 1px solid blue;*/ /*background: url("jslunbo1/images/logo1.png");*/ position: relative; opacity: 1; float: left; } #logo2{ width: 299px; height: 427px; /*border: 1px solid red;*/ /*background: url("jslunbo1/images/logo2.png");*/ opacity: 1; float: left; } #logo3{ width: 321px; height: 427px; /*border: 1px solid yellow;*/ /*background: url("jslunbo1/images/logo3.png");*/ opacity: 1; float: left;
jquery部分:
$(document).ready(function(){$("#logo1").hover( function(){ $("#juzhong").stop().animate({opacity: '1'},3000); $("#top").stop().animate({opacity: '0'},3000); }, function(){ $("#juzhong").stop().animate({opacity: '0'},3000); $("#top").stop().animate({opacity: '1'},3000); });$("#logo2").hover( function(){ $("#juzhong2").stop().animate({opacity: '1'},3000); $("#top2").stop().animate({opacity: '0'},3000); }, function(){ $("#juzhong2").stop().animate({opacity: '0'},3000); $("#top2").stop().animate({opacity: '1'},3000); });$("#logo3").hover( function(){ $("#juzhong3").stop().animate({opacity: '1'},3000); $("#top3").stop().animate({opacity: '0'},3000); }, function(){ $("#juzhong3").stop().animate({opacity: '0'},3000); $("#top3").stop().animate({opacity: '1'},3000); });});
小提醒:不要忘记引入jquery
0 0
- 使用jquery实现图片淡入淡出
- jquery图片淡入淡出
- jQuery实现首页图片淡入淡出效果
- jquery实现图片的淡入淡出
- jquery实现淡入淡出
- jquery 实现淡入淡出图片轮播效果
- jquery实现图片轮播_淡入淡出
- jQuery实现图片轮播(淡入淡出效果)
- js实现图片淡入淡出
- 【jQuery】使用fadeIn()与fadeOut()方法实现淡入淡出效果
- 使用TransitionDrawable实现多张图片淡入淡出的效果
- JQUERY实现背景图渐显(淡入淡出)
- jquery实现文字的淡入淡出
- jquery中实现显示、隐藏、淡入淡出
- jQuery实现窗口的淡入淡出效果
- 《JavaWeb---JQuery淡入淡出效果的实现》
- 运用JQuery实现淡出淡入效果
- 图片的淡入淡出的实现方法
- cpu使用率的计算
- JAVA调用webservice方法(axis)
- 翼支付重构门户架构之主从切换
- 快速排序(Quicksort)
- wget使用
- 使用jquery实现图片淡入淡出
- 事物的抽象
- LVS集群技术在教学资源库平台中的应用
- 一种自动化测试用例集生成工具——EvoSuite
- 练习5.25
- C++11 比较好的语法(一)
- java面向对象的三大特征
- Niginx应用——动静分离
- 用NuGet.Server管好自家的包包