JQUERY演示图片上下滑动展示效果
2009-09-23 22:55
555 查看
.mobansContainer{margin:0; padding:0;overflow:hidden;position:relative;}
.mobansSlider{position:absolute;}
.mobansSlider li{ list-style:none;display:inline;}
.rotatorNumber{position:absolute; right:5px; bottom:5px;}
.rotatorNumber li{float: left; color: #FF7300; text-align: center; line-height: 16px; width: 16px; height: 16px; font-family: Arial; font-size: 12px; cursor: pointer; overflow: hidden; margin: 3px 1px; border: 1px solid #FF7300; background-color: #fff;}
.rotatorNumber li.on{color: #fff; line-height: 21px; width: 21px; height: 21px; font-size: 16px; margin: 0 1px; border: 0; background-color: #FF7300; font-weight: bold;}
.mobansSlider img {height:188px;width:545px;border-width:0px;display:block;}
jquery确实是个好东西,简单方便,代码优美。下面是一个JQUERY实现的图片上下滚动的代码,模仿淘宝首页的广告图片展示效果
调用代码
$(function(){
var len = $("#numeric > li").length;
var index = 0;
$("#numeric li").mouseover(function(){
index = $("#numeric li").index(this);
rotatorimg(index);
});
$("#timer").hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
interval = setInterval(function(){
rotatorimg(index)
index++;
if(index==len){index=0;}
} , 2000);
});
var interval = setInterval(function(){
rotatorimg(index)
index++;
if(index==len){index=0;}
} , 5000);
})
function rotatorimg(i){
$("#mobanscnSlider").stop(true,false).animate({top : -188*i},400);
$("#numeric li").eq(i).addClass("on").siblings().removeClass("on");
}
1
2
3
4
下载地址:http://files.cnblogs.com/dotnetshow/Slider.rar
$(function(){
var len = $("#mobanscnNumer > li").length;
var index = 0;
$("#mobanscnNumer li").mouseover(function(){
index = $("#mobanscnNumer li").index(this);
show_ad2Rotator_Images(index);
});
$("#ad2Rotator_mobansContainer").hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
MyTime = setInterval(function(){
show_ad2Rotator_Images(index)
index++;
if(index==len){index=0;}
} , 5000);
});
var MyTime = setInterval(function(){
show_ad2Rotator_Images(index)
index++;
if(index==len){index=0;}
} , 5000);
})
function show_ad2Rotator_Images(i){
$("#mobanscnSlider").stop(true,false).animate({top : -188*i},400);
$("#mobanscnNumer li").eq(i).addClass("on").siblings().removeClass("on");
}
.mobansSlider{position:absolute;}
.mobansSlider li{ list-style:none;display:inline;}
.rotatorNumber{position:absolute; right:5px; bottom:5px;}
.rotatorNumber li{float: left; color: #FF7300; text-align: center; line-height: 16px; width: 16px; height: 16px; font-family: Arial; font-size: 12px; cursor: pointer; overflow: hidden; margin: 3px 1px; border: 1px solid #FF7300; background-color: #fff;}
.rotatorNumber li.on{color: #fff; line-height: 21px; width: 21px; height: 21px; font-size: 16px; margin: 0 1px; border: 0; background-color: #FF7300; font-weight: bold;}
.mobansSlider img {height:188px;width:545px;border-width:0px;display:block;}
jquery确实是个好东西,简单方便,代码优美。下面是一个JQUERY实现的图片上下滚动的代码,模仿淘宝首页的广告图片展示效果
调用代码
$(function(){
var len = $("#numeric > li").length;
var index = 0;
$("#numeric li").mouseover(function(){
index = $("#numeric li").index(this);
rotatorimg(index);
});
$("#timer").hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
interval = setInterval(function(){
rotatorimg(index)
index++;
if(index==len){index=0;}
} , 2000);
});
var interval = setInterval(function(){
rotatorimg(index)
index++;
if(index==len){index=0;}
} , 5000);
})
function rotatorimg(i){
$("#mobanscnSlider").stop(true,false).animate({top : -188*i},400);
$("#numeric li").eq(i).addClass("on").siblings().removeClass("on");
}
1
2
3
4
下载地址:http://files.cnblogs.com/dotnetshow/Slider.rar
$(function(){
var len = $("#mobanscnNumer > li").length;
var index = 0;
$("#mobanscnNumer li").mouseover(function(){
index = $("#mobanscnNumer li").index(this);
show_ad2Rotator_Images(index);
});
$("#ad2Rotator_mobansContainer").hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
MyTime = setInterval(function(){
show_ad2Rotator_Images(index)
index++;
if(index==len){index=0;}
} , 5000);
});
var MyTime = setInterval(function(){
show_ad2Rotator_Images(index)
index++;
if(index==len){index=0;}
} , 5000);
})
function show_ad2Rotator_Images(i){
$("#mobanscnSlider").stop(true,false).animate({top : -188*i},400);
$("#mobanscnNumer li").eq(i).addClass("on").siblings().removeClass("on");
}
相关文章推荐
- jquery上下页面视差滚动切换效果|强大的视差响应动画滑动图片切换效果
- JS感应鼠标的图片上下滑动展示效果
- JavaScript 图片滑动展示效果 转载自http://www.cnblogs.com/cloudgamer/
- Revealing图片展示效果(jQuery)
- jQuery演示8种不同的图片遮罩层动画效果
- jquery.gridrotator实现响应式图片展示画廊效果
- 原来操控界面可以这么简单----安卓上下滑动缩放顶部图片,左右滑动结束当前Activity,及View柔和回弹效果
- 使用viewpager嵌套实现上下左右滑动切换图片(IOS双向滚动翻页效果相同)
- jQuery实现右侧显示可向左滑动展示的深色QQ客服效果代码
- 如何用Jquery做图片展示效果
- jQuery演示10种不同的切换图片列表动画效果
- jQuery实现QQ空间图片展示效果
- 基于Flex 4.6实现 Picture Slide (图片滑动展示效果)
- 一个支持任意尺寸的图片上下左右滑动效果
- jquery picswitch图片焦点图展示效果
- jQuery:图片展示效果
- 60款很酷的 jQuery 幻灯片演示和下载--多张图片Flash切换效果
- jQuery实例:图片展示效果
- JavaScript html 图片滑动切换效果,幻灯片式切换,新闻展示,滚动新闻
- 一款基于jquery的手风琴图片展示效果