本文实例为大家分享了jquery轮播图插件使用案例,供大家参考,具体内容如下
代码
$(function(){
$(".carousel-content").carousel({
carousel : ".carousel",//轮播图容器
indexContainer : ".img-index",//下标容器
prev : ".carousel-prev",//左按钮
next : ".carousel-next",//右按钮
timing : 2000,//自动播放间隔
animateTime : 700,//动画时间
autoPlay : true,//是否自动播放 true/false
direction : "left",//滚动方向 right/left
});
$(".carousel-content").hover(function(){
$(".carousel-prev,.carousel-next").fadeIn(300);
},function(){
$(".carousel-prev,.carousel-next").fadeOut(300);
});
$(".carousel-prev").hover(function(){
$(this).find("img").attr("src","img/left2.png");
},function(){
$(this).find("img").attr("src","img/left1.png");
});
$(".carousel-next").hover(function(){
$(this).find("img").attr("src","img/right2.png");
},function(){
$(this).find("img").attr("src","img/right1.png");
});
});
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。