我正在使用这个:
$(function() {
// initialize scrollable
window.api = $("div.scrollable").scrollable({
clickable: true,
activeClass: "active",
onSeek: function() {
alert("current position is: " + this.getIndex());
//remove highlighting from all images
$(".items img").removeClass("selected");
var position = this.getIndex().toString();
var thisItem = $(".items:nth-child(" + position + ")");
//var thisItem = allItems(this.getIndex);
alert("item is: " + $(this).attr('alt'));
changeimage($(".items:nth-child(2)"));
}
}).circular().autoscroll({
interval: 4000,
api: true,
autoplay: false,
steps: 1
});
});
(只是测试)以便我可以将当前项目解析为我的 changeimage() 函数但是我在警报中得到的所有内容都是未定义的。我需要在这里做什么才能获得当前项目