HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Cache-Control" content="no-transform " />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.10.1.js"></script>
<style type="text/css"> ul,ol,li{list-style:none;}
.box{width:320px; height:240px;}
.box ul li {float:left; position:absolute; display:none;width:320px; height:240px;}
</style>
</head> <body>
<div class="box">
<ul>
<li><a href="#" target="_blank"><img src="data:images/1.jpg" width="350" height="240" /></a></li>
<li><a href="#" target="_blank"><img src="data:images/2.jpg" width="350" height="240" /></a></li>
<li><a href="#" target="_blank"><img src="data:images/3.jpg" width="350" height="240" /></a></li>
<li><a href="#" target="_blank"><img src="data:images/4.jpg" width="350" height="240" /></a></li>
<li><a href="#" target="_blank"><img src="data:images/5.jpg" width="350" height="240" /></a></li>
<li><a href="#" target="_blank"><img src="data:images/6.jpg" width="350" height="240" /></a></li>
</ul>
</div>
<input class="prev" type="button" value="向上" />
<input class="next" type="button" value="向下" />
</body>
</html>
<strong></strong>

Javascript:

$(function(){
var Get_next_j=$('.box ul li');
var Set_css_item={'display':'list-item','position':'relative','float':'left'};
var Set_css_none={'display':'list-item','position':'absolute','float':'left'};
var Set_time=2000;
var i=0;
Get_next_j.first().css(Set_css_item);
$('.next').click(function(){
if(!Get_next_j.eq(i).next().html())
{
Get_next_j.last().fadeOut(Set_time).css(Set_css_none);
Get_next_j.first().fadeIn(Set_time).css(Set_css_item);
i=0;
}
else{
Get_next_j.eq(i).fadeOut(Set_time).css(Set_css_none);
Get_next_j.eq(i).next().fadeIn(Set_time).css(Set_css_item);
i=i+1;}
});
$('.prev').click(function(){
if(i==0){
Get_next_j.first().fadeOut(Set_time).css(Set_css_none);
Get_next_j.last().fadeIn(Set_time).css(Set_css_item);
Get_next_j.each(function(index,element){
i=index;
});
}
else{
Get_next_j.eq(i).fadeOut(Set_time).css(Set_css_none);
Get_next_j.eq(i).prev().fadeIn(Set_time).css(Set_css_item);
i=i-1;}
});
});

Juery 实现淡出 淡现效果的更多相关文章

  1. 类似UC天气下拉和微信下拉眼睛头部弹入淡出UI交互效果(开源项目)。

    Android-PullLayout是github上的一个第三方开源项目,该项目主页是:https://github.com/BlueMor/Android-PullLayout  原作者项目意图实现 ...

  2. QT窗口渐现效果,窗口震动效果,鼠标移动窗口

    //窗口渐现效果void MainWindow::closeWindowAnimation() //关闭窗口效果 { QPropertyAnimation *animation = new QProp ...

  3. jQuery淡入淡出瀑布流效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. jQuery练手:仿新浪微博图片文字列表淡进淡出上下滚动效果

    1.效果及功能说明 仿新浪微博图片文字列表上下淡进淡出间歇上下滚动 2.实现原理 首先要设定div内只能显示4个图片那么多出来的图片会自动隐藏然后在给图片添加一个动画的事件让他们可以滚动的播放出来上下 ...

  5. Unity3D中UGUI不使用DOTween制作渐隐渐现效果

    在做UI后期设计时,我们可能要对UI做一些特效,这篇文章我们来学习下如何在Unity3d中对实现渐隐渐现的效果, 首先我们看下Unity New UI即UGUI中渐隐渐现的做法. 观察我们会发现Uni ...

  6. WPF实现渐变淡入淡出的动画效果

    1.实现原理 1.1 利用UIElement.OpacityMask属性,用于改变对象区域的不透明度的画笔.可以使元素的特定区域透明或部分透明,从而实现比较新颖的效果. 1.2 OpacityMask ...

  7. WinForm利用 WinApi实现 淡入淡出 弹出 效果 仿QQ消息

    消息框: using System.Runtime.InteropServices; namespace Windows_API_实现屏幕右下角_消息框_ { public partial class ...

  8. 在Unity5中使用C#脚本实现UI的下滑、变色、渐隐渐现效果

    一.首先,我们先创建一个Text    依次选择Component→UI→Text创建一个Text,创建完成后如下: 二.创建完成后,在Project面板点击Create→C# Script,本例命名 ...

  9. css3 hover平滑过渡效果,鼠标经过元素,背景渐隐渐现效果

    下面实例,演示,鼠标经过时,改变div宽度,平滑改变,带动画 div { width:100px; height:100px; background:blue; transition:width 2s ...

随机推荐

  1. 修改MAC地址的方法(未测试)

    用ioctl控制,通过SIOCGIFHWADDR获取MAC地址,SIOCSIFHWADDR设置MAC地址,不过在设 置MAC地址之前,要先把网卡down掉,设置好了以后,再UP起来. #include ...

  2. vs2012团队连接(Team Foundation Server)怎样从已登录的用户退出

    在用visual studio 连接团队项目时,首次输入用户名和密码后,默认保存住凭据了,等以后连接会自动采用首次的凭证. 但是如何采用新的用户重新登录呢 解决方法有两个: 1.删除原有账号登陆的凭证 ...

  3. angular封装jquery插件(组件)

    http://www.phloxblog.in/jquery-plugin-angular-js-directive-clean-html-approach/#.VaCWL9yUemJ

  4. zoj3888

    题解: 维护比这个大的第二大 代码: #include<cstdio> #include<algorithm> #include<queue> #include&l ...

  5. js在类似数组的对象中使用push

    let obj = { "2": "a", "3": "b", length: 3, push: Array.proto ...

  6. Oracle 将另外一张表的列更新到本表的列

    Oracle写法: update temp_agentpay_df q set q.up_batch_bizid=(select c.batch_bizid from temp_df_id c whe ...

  7. 使用API接口在zabbix系统中登陆、创建、删除agent

    一.API的介绍 API(Application Programming Interface,应用程序编程接口)是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力 ...

  8. 1.1.1 A+B for Input-Output Practice (I)

    A+B for Input-Output Practice (I) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...

  9. magento建立多语言网站

    默认Magento仅仅有English语言包,所以如果想也显示中文,就要安装中文语言包. 步骤: 1. 首先,去http://www.magentocommerce.com/langs/list/下载 ...

  10. 在python中的使用

    操作步骤: 1. 连接数据库,生成数据库连接对象 conn = pymongo.MongoClient('localhost',27017) 2. 选择要操作的数据库,生成数据库对象 (__setit ...