我正在寻找一些带有上一个/下一个按钮的画廊,我找到了它。我有代码:
var speed = 0;
$('#mask-gallery, #gallery li').width($('#slider').width());
$('#gallery').width($('#slider').width() * $('#gallery li').length);
$('#mask-gallery, #gallery li').height($('#slider').height());
$('#gallery li:first').addClass('selected');
$('#btn-next, #gallery').click(function () {
newsscoller(0);
return false;
});
$('#btn-prev').click(function () {
newsscoller(1);
return false;
});
function newsscoller(prev) {
var current_image = $('#gallery li.selected').length ? $('#gallery li.selected') : $('#gallery li:first');
if (prev) {
var next_image = (current_image.prev().length) ? current_image.prev() : $('#gallery li:last');
} else {
var next_image = (current_image.next().length) ? current_image.next() : $('#gallery li:first');
}
$('#gallery li').removeClass('selected');
next_image.addClass('selected');
$('#mask-gallery').scrollTo(next_image, 250);
}
我有一个问题。任何人都知道它的脚本如何在最后一张幻灯片之后将用户重定向到定义的页面(location.href = '';)?
感谢您的回复!