1.css

<style>

.fl {
float: left;
}
.slider0 img {
display: block;
width:100px;
padding: 2px; }
.slider0 li {
background: url("http://www.lampbrother.net/php/statics/images/lamp/php_qiye_bg.png") no-repeat scroll 120px 5px ;
color: #000000;
font-size: 15px;
height: 150px;
margin-left: 10px;
overflow: hidden;
padding: 10px 0;
width: 100%;
}
.slider0 p {
color: #808080;
float: left;
font: 12px/25px Verdana,Tahoma,'Microsoft Yahei','Simsun';
margin: 10px 0 0;
padding-left: 70px;
width: 720px;
}
.slider0 .tit {
color: #333333;
font: 15px/25px Verdana,Tahoma,'Microsoft Yahei','Simsun';
}
</style>

2.html

     <div class="wp">

                <ul id="slider" class="slider0" style="top: 0px;list-style-type: disc;">
<li style="opacity: 1;">
<a class="fl"><img src="<?=base_url('uploads')?>/tou1.jpg" alt="php视频教程|php教程"></a>
<p class="tit">李明珠</p>
<p>很好!</p>
</li><li style="opacity: 1;">
<a class="fl"><img src="<?=base_url('uploads')?>/tou2.jpg" alt="php视频教程|php教程"></a>
<p class="tit">李海海</p>
<p>good</p>
</li><li style="opacity: 1;">
<a class="fl"><img src="<?=base_url('uploads')?>/tou3.jpg" alt="php视频教程|php教程"></a>
<p class="tit">刘旭东</p>
<p>太棒了!</p>
</li><li style="opacity: 1;">
<a class="fl"><img src="<?=base_url('uploads')?>/tou4.jpg" alt="php视频教程|php教程"></a>
<p class="tit">陈陈</p>
<p>很强大!</p>
</li>
</ul>
</div>

3.js

<script type="text/javascript">
function H$(i) {return document.getElementById(i)}
function H$$(c, p) {return p.getElementsByTagName(c)}
var slider = function () {
function init (o) {
this.id = o.id;
this.at = o.auto ? o.auto : 3;
this.o = 0;
this.pos();
}
init.prototype = {
pos : function () {
clearInterval(this.__b);
this.o = 0;
var el = H$(this.id), li = H$$('li', el), l = li.length;
var _t = li[l-1].offsetHeight;
var cl = li[l-1].cloneNode(true);
cl.style.opacity = 0; cl.style.filter = 'alpha(opacity=0)';
el.insertBefore(cl, el.firstChild);
el.style.top = -_t + 'px';
this.anim();
},
anim : function () {
var _this = this;
this.__a = setInterval(function(){_this.animH()}, 20);
},
animH : function () {
var _t = parseInt(H$(this.id).style.top), _this = this;
if (_t >= -1) {
clearInterval(this.__a);
H$(this.id).style.top = 0;
var list = H$$('li',H$(this.id));
H$(this.id).removeChild(list[list.length-1]);
this.__c = setInterval(function(){_this.animO()}, 20);
//this.auto();
}else {
var __t = Math.abs(_t) - Math.ceil(Math.abs(_t)*.07);
H$(this.id).style.top = -__t + 'px';
}
},
animO : function () {
this.o += 2;
if (this.o == 100) {
clearInterval(this.__c);
H$$('li',H$(this.id))[0].style.opacity = 1;
H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity=100)';
this.auto();
}else {
H$$('li',H$(this.id))[0].style.opacity = this.o/100;
H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity='+this.o+')';
}
},
auto : function () {
var _this = this;
this.__b = setInterval(function(){_this.pos()}, this.at*1000);
}
}
return init;
}();
new slider({id:'slider'})

</script>

jquery 滚动效果插件的更多相关文章

  1. fullPage教程 -- 整屏滚动效果插件 fullpage详解

    1.引用文件 [html] view plain copy print?在CODE上查看代码片派生到我的代码片 <link rel="stylesheet" href=&qu ...

  2. 95+强悍的jQuery图形效果插件

    现在的网站越来越离不开图形,好的图像效果能让你的网站增色不少.通过JQuery图形效果插件可以很容易的给你的网站添加一些很酷的效果. 使用JQuery插件其实比想象的要容易很多,效果也超乎想象.在本文 ...

  3. javascript跟随滚动效果插件代码(javascript Follow Plugin)

    这篇文章介绍了javascript跟随滚动效果插件代码(javascript Follow Plugin),有需要的朋友可以参考一下Js 跟随滚动效果插件支持定义多个跟随ID,采用css fixed属 ...

  4. jQuery Lightbox效果插件Boxer

    演示:http://www.jq22.com/yanshi1139 下载:链接: https://pan.baidu.com/s/1o8zaV2q 密码: 2ccy Boxer 是一款基于 jQuer ...

  5. jquery 动画效果插件

    从jQuery API 文档中可以知道,jQuery自定义动画的函数.animate( properties [, duration] [, easing] [, complete] )有四个参数: ...

  6. jq无缝滚动效果插件(之前的那个升级改造加强版)

    scroll滚动插件 支持上下左右,淡入淡出,滚动时间设置,动画时间设置,鼠标经过是否停止设置 默认配置参数可修改 $(".content").easysroll({ //默认配置 ...

  7. 分享七款视差滚动效果的jQuery 插件

    视差(Parallax)是指从不同的点看一个物体时形成的视觉差异,这个名词是源自希腊文的παράλλαξις (parallaxis),意思是”改变”.在网页设计中,视差滚动(Parallax Scr ...

  8. 10 款基于 jQuery 的切换效果插件推荐

    本文整理了 10 款非常好用的 jQuery 切换效果插件,包括平滑切换和重叠动画等,这些插件可以实现不同元素之间的动态切换. 1. InnerFade 这是一个基于 jQuery 的小插件,可以实现 ...

  9. 12款响应式 Lightbox(灯箱)效果插件

    灯箱效果(Lightbox)是网站中最常用的效果之一,用于实现类似模态对话框的效果.网络上各种 Lightbox 插件琳琅满目,随着响应式设计(Respnsive Design)的发展,这一先进理念也 ...

随机推荐

  1. Java中Vector笔记

    Vector和ArrayList Vector和ArrayList在使用上非常相似,都可用来表示一组数量可变的对象应用的集合,并且可以随机地访问其中的元素.   Vector的方法都是同步的(Sync ...

  2. 前端优化 -- Combo Handler

    Combo Handler来合并CSS/JS文件 背景 Combo Handler是Yahoo!开发的一个Apache模块,它实现了开发人员简单方便地通过URL来合并JavaScript和CSS文件, ...

  3. K均值聚类(C++)

    #include<math.h> #include<stdio.h> #include<stdlib.h> #include<iostream> usi ...

  4. Codeforces 509E(思维)

                                                                                                         ...

  5. Jackson是线程安全的吗

    网上说是线程安全的,内部代码用了ThreadLocal.Synchronized这些线程安全类和关键字,可以放心的用. 避免每次使用都new一个,全局配置一个ObjectManager的对象将大大减少 ...

  6. 《Microsoft SQL Server 2008 Internals》读书笔记--目录索引

    http://blog.csdn.net/downmoon/article/details/5256548 https://sqlserverinternals.com/companion/

  7. 80端口被屏蔽解决方法,80端口穿透之NAT端口映射技术

    介绍一种NAT端口映射技术应用,达到80端口穿透目的,解决80端口被屏蔽的问题,也是80端口被屏蔽解决方法中经常用到的. 80端口穿透类似80端口转发,因为80端口被屏蔽,在数据层面来说是不能直接访问 ...

  8. 说说GestureDetector.OnGestureListener onScroll函数

    public abstract boolean onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) ...

  9. wxWidgets 安装方法(Windows 8.1 + Visual Studio 2013)

    在windows 8.1上面,搭建基于visual studio 2013的wxWidgets的开发环境,方法如下: 下载  目前最新版本为3.0.0,下载地址: http://sourceforge ...

  10. 经验分享 | Burpsuite抓取非HTTP流量

    使用Burp对安卓应用进行渗透测试的过程中,有时候会遇到某些流量无法拦截的情况,这些流量可能不是HTTP协议的,或者是“比较特殊”的HTTP协议(以下统称非HTTP流量).遇到这种情况,大多数人会选择 ...