0
這裏我使用的是http://specious.github.io/cloud9carousel/滑塊, 我想添加活動類,當圖像旋轉在正面。jquery動畫cloud9傳送帶添加活動類
這裏我使用的是http://specious.github.io/cloud9carousel/滑塊, 我想添加活動類,當圖像旋轉在正面。jquery動畫cloud9傳送帶添加活動類
您可以添加「onRendered」回調函數 我用它爲我工作
var showcase = $("#showcase")
var card = $("#showcase .card")
showcase.Cloud9Carousel({
yOrigin: 42,
yRadius: 40,
itemClass: "card",
buttonLeft: $(".nav2.prev"),
buttonRight: $(".nav2.next"),
bringToFront: true,
onRendered: showcaseUpdated,
onLoaded: function() {
showcase.css('visibility', 'visible')
showcase.css('display', 'none')
showcase.fadeIn(1500)
}
})
function showcaseUpdated(showcase) {
$(card).removeClass('active');
var index = showcase.nearestIndex();
$(showcase.items[index].element).addClass('active');
}
由於大衆需求,爲2.2.0版本,通過frontItemClass
財產automatically tags提供您所選擇的類名最前面的項目:
var carousel = $("#carousel")
carousel.Cloud9Carousel({
// ...
frontItemClass: "active"
})
對於JS Bin的生活demo。
請問您可以添加樣品到目前爲止您嘗試過嗎? –
我已經使用這個插件,但我無法看到活動類, 所以我想讓CSS哪個圖像是前端, –