好的,我在jQuery 论坛上添加了我的问题,创建者回复了以下答案。
这是我为此开发的代码:
var slideIndex = 0;
var nextIndex = 0;
var prevIndex = 0;
$('#banner_content').cycle({
fx: 'fade',//fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
timeout: 8000,
speed: 1000,
easingIn:20,
easingOut:40,
after: function(currSlideElement, nextSlideElement, options) {
slideIndex = options.currSlide;
nextIndex = slideIndex + 1;
prevIndex = slideIndex -1;
if (slideIndex == options.slideCount-1) {
nextIndex = 0;
}
if (slideIndex == 0) {
prevIndex = options.slideCount-1;
}
}
});
$("div.left_arrow a").click(function () {
$('#banner_content').cycle(nextIndex, "scrollRight");
});
$("div.right_arrow a").click(function () {
$('#banner_content').cycle(prevIndex, "scrollLeft");
});