抖动轮换的图片切换效果丨www.CsrCode.cn
※丨www.CsrCode.cn丨seo丨www.seonet.net丨网页特效|网页图片特效|网页特效代码|链接交换平台
『芯晴网页特效』文章由 芯晴网页特效|CsrCode.CN 收集(www.CsrCode.cn)
详文参考:http://www.csrcode.cn/html/txdm/txtx/2102.htm
代码如下:
————————————————
<!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>
<title>抖动轮换的图片切换效果丨芯晴网页特效丨CsrCode.Cn</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<style type="text/css">
#box{
border:1px solid #9599A5;
background:#C4C7D3;
width:628px;
height:150px;
}
#imgPanel{
height:100px;
position:relative;
overflow:hidden;
z-index:1;
}
#ctrlPanel{
border:1px solid #aaa;
background:#fff;
height:30px;
margin:5px;
padding:5px;
position:relative;
z-index:0;
}
img{
position:absolute;
padding:5px;
background:#fff;
border:1px solid #999;
bottom:0px;
left:-999px;
width:200px;
}
#bg{
position:absolute;
width:170px;
height:90px;
border:1px solid #aaa;
border-bottom:none;
background:#fff;
top:-91px;
left:223px;
}
#ctrlPanel button{
width:45px;
line-height:20px;
}
#next{
position:absolute;
top:5px;
right:5px;
}
#adTilte{
position:absolute;
top:8px;
left:100px;
color:#CC0000;
font-size:20px;
font-family:黑体;
}
</style>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<div id="box">
<div id="imgPanel">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/1.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/2.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/3.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/4.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/5.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/6.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/7.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/8.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/9.jpg">
<img src="http://www.CsrCode.cn/html/txdm_2/images/20100826/10.jpg">
</div>
<div id="ctrlPanel">
<div id="bg"></div>
<div id="adTilte">怎么样来的风,怎么样吹过……</div>
<button id="prev" onclick="BlueJS.prev();"><</button>
<button id="next" onclick="BlueJS.next();">></button>
</div>
</div>
<script language="javascript">
var curcve=function (t, b, c, d){
if ((t /= d) < (1 / 2.75)) {
return c * (7.5625 * t * t) + b;
} else if (t < (2 / 2.75)) {
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
} else if (t < (2.5 / 2.75)) {
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
} else {
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
}
};
BlueJS={
fx:(function (){
var core=function (el,style,to){
clearInterval(el['fxID_'+style]);
var from=el['offset'+style.charAt(0).toUpperCase()+style.slice(1)];
var set=function (x){el.style[style]=x+'px'},time=360/10,
fx = (function(from, to, timeout, s, a, p) {
var c = to - from,d = timeout,b = from;
return function (){return curcve(t,b,c,d)}
})(from, to, time),
t=0;
el['fxID_'+style]=setInterval(function(){
t++<time?set(fx(t)):set(to,clearInterval(el['fxID_'+style]));
},10);
};
return function (el,set){for (var Id in set)core(el,Id,set[Id])};
})(),
setFx:function (isNext){
var data=[[10,80],[112,100],[235,148],[405,100],[525,80],[-50,20],[640,20]];
for (var i=0;i<this.pics.length;++i ) {
var img=this.pics[i],v=i;
if(isNext&&i==0||i>4){
img.style.left='-40px';
img.style.width='20px';
};
if(!isNext){
if(i==this.pics.length-1){v=5};
if(i==4){
img.style.left='645px';
img.style.width='20px';
};
};
if(i>4)continue;
this.fx(img,{left:data[v][0],width:data[v][1]});
};
},
prev:function (){
this.pics.push(this.pics.shift());
this.setFx();
},
next:function (){
this.pics.unshift(this.pics.pop());
this.setFx(1);
},
init:function (){
this.box=document.getElementById("box");
var pics=this.box.getElementsByTagName("IMG");
this.pics=[];
for (var i=0;i<pics.length;++i ) this.pics.push(pics[i]);
this.setFx();
}
};
window.onload = function (){
BlueJS.init();
setInterval(function(){
BlueJS.prev();
},2000);
}
</script>
</body>
</html>
<p align="center">本特效由 <a href="http://www.CsrCode.cn">芯晴网页特效</a>丨CsrCode.Cn 收集于互联网,只为兴趣与学习交流,不作商业用途。</p>
————————————————
推荐阅读:
※丨www.CsrCode.cn丨seo丨www.seonet.net丨网页特效|网页特效代码|链接交换平台
※丨菜单特效|导航特效|菜单导航特效|页面特效|窗口特效|背景特效|网页背景特效
※丨图层特效|样式特效|图层样式特效|鼠标特效|表格特效|表单特效|状态栏特效
※丨链接特效|文字特效|时间特效|日期特效|js日历|万年历|日历特效|导航菜单
※丨图片特效|图形图像特效|图片切换特效|图片flash|焦点图片特效|图片切换效果
※丨www.CsrCode.cn|网页特效|特效代码|网页图片特效|网页特效代码大全|网页特效集锦
※丨搜索引擎优化丨seo优化丨seo丨网站优化丨网络营销丨百度优化丨谷歌优化丨杭州seo
※丨站长工具箱|网站查询工具|友情链接交换平台|seo自动推广|芯晴淘宝站
※丨芯晴驿站生活常识网网罗流行的各种减肥方法/减肥秘方/瘦身秘诀/护肤知识
※丨【互利多SEO全能优化软件】免费seo优化工具
※丨猪八戒网丨高额悬赏任务丨赶快行动,机会就属于你
※丨芯晴源码下载丨淘客源码下载丨CMS系统源码下载丨源码下载
※丨生活常识网心情驿站收集各种减肥食谱/减肥产品的相关资料,教你如何美容瘦身
※丨[酷] flash效果展开层、关闭层,并且可以拖动层
※丨[荐] 用CSS控制文字显示在一条线的中间
※丨一款免费的seo软件【seo助理】功能比较强大
※丨27个比较好的免费CMS系统大全
※丨【贴图】美丽的【纸玫瑰】【川崎玫瑰】【教程】
※丨Flash素材|透明flash|烟花flash|金鱼flash|下雨flash|flash风景|flash资源
※丨[酷] 纯CSS实现的百度百科里的CSS圆角效果
※丨[酷] CSS+JS实现一个DIV层的展开/折叠效果
※丨[荐] 用CSS定义层的透明效果
※丨[荐] 纯CSS实现多列等高布局,绝对值得收藏
※丨一款很不错的Js控制div层拖动/拖放代码
※丨[荐] 一款常用的带关闭功能的对联广告特效
※丨[荐] 一款常用的网页漂浮广告的代码
※丨[荐] 一款常见的图文混排的Blog文章列







发表评论 评论 (0 个评论)