我有这个脚本,我想添加一个自动播放模式。这是开始:
$(document).ready(function () {
var carousel = $("#carousel").waterwheelCarousel({
flankingItems: 3,
movingToCenter: function ($item) {
$('#callback-output').prepend('movingToCenter: ' + $item.attr('id') + '<br/>');
},
movedToCenter: function ($item) {
$('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>');
},
movingFromCenter: function ($item) {
$('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>');
},
movedFromCenter: function ($item) {
$('#callback-output').prepend('movedFromCenter: ' + $item.attr('id') + '<br/>');
},
clickedCenter: function ($item) {
$('#callback-output').prepend('clickedCenter: ' + $item.attr('id') + '<br/>');
}
});
以下是导航按钮:
$('#prev').bind('click', function () {
carousel.prev();
return false
});
$('#next').bind('click', function () {
carousel.next();
return false;
});
$('#reload').bind('click', function () {
newOptions = eval("(" + $('#newoptions').val() + ")");
carousel.reload(newOptions);
return false;
});
});
谁能帮我做到这一点?
这是我的css
代码:
body {
font-family:Arial;
font-size:12px;
background:#ededed;
}
.example-desc {
margin:3px 0;
padding:5px;
}
#carousel {
width:960px;
height:300px;
position:relative;
clear:both;
overflow:hidden;
}
隐藏图像,直到轮播可以处理它们,否则无法单击明显的项目:
#carousel img {
visibility:hidden;
cursor:pointer;
}
.split-left {
width:450px;
float:left;
}
.split-right {
width:400px;
float:left;
margin-left:10px;
}
#callback-output {
height:250px;
overflow:scroll;
}
textarea#newoptions {
width:430px;
}