本文实例讲述了jQuery实现的左右移动焦点图效果。分享给大家供大家参考,具体如下:
jquery 部分:
= 450){
_direction = 'right';
}else{
$(".flow ul").animate({"margin-left":"-=" + _size + "px"});
_len += _size;
}
}else{
if(_len <= 0){
_direction = 'left';
}else{
$(".flow ul").animate({"margin-left":"+=" + _size + "px"});
_len -= _size;
}
}
}
var _go = setInterval(mar,_speed);
$("#pic_left").click(function (){
_direction = 'left';
});
$("#pic_right").click(function (){
_direction = 'right';
});
$(".flow li").mouSEOver(function (){
clearInterval(_go);
}).mouSEOut(function (){
_go = setInterval(mar,_speed);
});
});
html 部分