1
我想创建一个div,内容在特定时间段后水平滚动 - 就像幻灯片一样。我正在使用mcustomscollbar插件。我正在使用for循环来增加id的值,并使用scrollTo函数来滑动内容,但滚动跳转到最后一个。mcustom滚动条自动滚动问题
这里其JS
for (var num = 1; num < 24; num++) {
var idj = '#' + 'id' + num;
var dlp = scrollToI(idj);
}
function scrollToI(person) {
setTimeout(function() {
console.log(person);
$('#content1').mCustomScrollbar("scrollTo", person);
}, 2000);
}
小提琴:使用http://jsfiddle.net/infern00/3psLU/
滚动条插件:http://manos.malihu.gr/jquery-custom-content-scroller/
很好完美工作。谢谢你的帮助。 – Vikas