用jQuery+css+div 写一个 乱换效果
2012-04-28 17:09
190 查看
源码请上群索要,纯属原创 如有雷同 一定是缘分
用jQuery+css+div 写一个 轮换效果。无聊之作 专注后台开发 但是超级喜欢div+css 和js 最近看看html5 和css3
// var lip = 0;
//计时器
var init ;
var CurrAutoIndex=0;
jQuery(".adPic a:first").attr('id', 'aOne');
var aLength = jQuery(".adPic a").size();
var adPicWidth= 202;//= aLength * 505;
jQuery(function($){
//$(".adPic").css("width", adPicWidth);
$(".Items").css("opacity", 0.5);
$(".Items").hover(function () {
$(this).css("opacity", 1);
var thisIndex=$(this).index();
goLeft(thisIndex-0);
}, function () {
})
jQuery(".Items").mousemove(function(){
window.clearInterval(init);
$(".Items").css("opacity", 0.5);
$(this).css("opacity", 1);
});
jQuery(".Items").mouseout(function(){
init=setInterval("AutoLeft()",5000);
})
function goLeft(currIndex) {
$("#aOne").stop();
var liveLeft = -currIndex * 202;
$("#aOne").animate({ "marginTop": liveLeft }, 300);
CurrAutoIndex=currIndex+1;
}
})
init=setInterval("AutoLeft()",4000);
function AutoLeft() {
if(CurrAutoIndex>3)
CurrAutoIndex=0;
jQuery("#aOne").stop();
var liveLeft = -CurrAutoIndex * 202;
jQuery("#aOne").animate({ "marginTop": liveLeft }, 300);
jQuery(".buttomMen div").css("opacity", 0.5);
jQuery(".buttomMen div:eq("+CurrAutoIndex+")").css("opacity", 1);
CurrAutoIndex=CurrAutoIndex+1;
}
// ]]>
用jQuery+css+div 写一个 轮换效果。无聊之作 专注后台开发 但是超级喜欢div+css 和js 最近看看html5 和css3
// var lip = 0;
//计时器
var init ;
var CurrAutoIndex=0;
jQuery(".adPic a:first").attr('id', 'aOne');
var aLength = jQuery(".adPic a").size();
var adPicWidth= 202;//= aLength * 505;
jQuery(function($){
//$(".adPic").css("width", adPicWidth);
$(".Items").css("opacity", 0.5);
$(".Items").hover(function () {
$(this).css("opacity", 1);
var thisIndex=$(this).index();
goLeft(thisIndex-0);
}, function () {
})
jQuery(".Items").mousemove(function(){
window.clearInterval(init);
$(".Items").css("opacity", 0.5);
$(this).css("opacity", 1);
});
jQuery(".Items").mouseout(function(){
init=setInterval("AutoLeft()",5000);
})
function goLeft(currIndex) {
$("#aOne").stop();
var liveLeft = -currIndex * 202;
$("#aOne").animate({ "marginTop": liveLeft }, 300);
CurrAutoIndex=currIndex+1;
}
})
init=setInterval("AutoLeft()",4000);
function AutoLeft() {
if(CurrAutoIndex>3)
CurrAutoIndex=0;
jQuery("#aOne").stop();
var liveLeft = -CurrAutoIndex * 202;
jQuery("#aOne").animate({ "marginTop": liveLeft }, 300);
jQuery(".buttomMen div").css("opacity", 0.5);
jQuery(".buttomMen div:eq("+CurrAutoIndex+")").css("opacity", 1);
CurrAutoIndex=CurrAutoIndex+1;
}
// ]]>
相关文章推荐
- JS+CSS实现鼠标经过弹出一个DIV框完整实例(带缓冲动画渐变效果)
- 比较漂亮的一个导航条的效果DIV+CSS
- 一个非常棒的DIV+CSS导航条效果!
- 超经典jquery+CSS+DIV实现图片轮换效果
- 比较漂亮的一个导航条的效果DIV+CSS
- 自己用jquery+css+div写的一个弹窗
- 一个很美观的标签云效果,纯DIV+CSS布局
- JS+CSS实现鼠标经过弹出一个DIV框完整实例(带缓冲动画渐变效果)
- 一个导航条的效果DIV+CSS
- css效果,在一个盒子里,把一部分内容隐藏掉,在鼠标悬停到div时,就会把隐藏的部分向上显示出来。 不用js操作,纯css就可以。
- 一个关于css+div娱乐效果
- (转)css中通常会用到浮动与清除,也是一个必须掌握的知识点,概念性的东西不多说,下面举几个例子,来说明它的用法:1.文字环绕效果 2.多个div并排显示 3.清除浮动(默认显示)
- 一个DIV+CSS导航条效果
- 分享一个CSS,可以实现很棒的提示效果
- css案例学习之div ul li a 实现导航效果
- div+css实现一个可输入的下拉框
- CSS+jQuery实现的一个放大缩小动画效果
- 用div+css实现简单下拉菜单效果
- 自己写的一个div随页面滚动的效果
- 使用div作出一个模态框的效果