by zhangxinxu 2009-12-21 21:55

jQuery全能列表淡入淡出插件

1.新闻内容的滚动切换显示

相应HTML代码:
<ul id="news"> <li>·<a href="javascript:">二套房贷首付或提至50% 政府拟打压楼市</a></li> <li>·<a href="javascript:">陈云林抵台参加会谈 向绿营抗议者挥手</a></li> <li>·<a href="javascript:">全国猪肉出场价连涨6周 农产品涨价幅度大</a></li> <li>·<a href="javascript:">社会蓝皮书:明年底人均GDP将接近4000美元</a></li> <li>·<a href="javascript:">媒体称中央拟明年推行官员任用提名新制度</a></li> <li>·<a href="javascript:">中法167亿建核电公司 合资造大飞机发动机</a></li> </ul>

2.图片列表的幻灯片切换显示

相应HTML代码:
<ul id="album"> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm1.jpg" /></a></li> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm3.jpg" /></a></li> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm4.jpg" /></a></li> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm6.jpg" /></a></li> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm8.jpg" /></a></li> <li><a href="javascript:"><img height="191" src="//image.zhangxinxu.com/image/study/s/s256/mm10.jpg" /></a></li> </ul>

3.class形式的切换

1

2

3

4

5

6

7

8

9

a

b

c

d

e

f

g

h

i

相应HTML代码:
<div class="fade"> <p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p> </div> <div class="fade"> <p>a</p><p>b</p><p>c</p><p>d</p><p>e</p><p>f</p><p>g</p><p>h</p><p>i</p> </div>
页面jQuery代码:
$(function(){ $("#news").innerfade({ animationtype: "slide", speed: 750, timeout: 2000, type: "random", containerheight: "1em" }); $("#album").innerfade({ speed: "slow", timeout: 4000, type: "sequence", containerheight: "191px" }); $(".fade").innerfade({ speed: "slow", timeout: 1000, type: "sequence", containerheight: "1.2em" }); });