1
Ext.carousel.Carousel似乎沒有點擊事件。我如何讓旋轉木馬響應點按事件? (tap,itemtap等)點擊事件Ext.carousel.Carousel
Ext.carousel.Carousel似乎沒有點擊事件。我如何讓旋轉木馬響應點按事件? (tap,itemtap等)點擊事件Ext.carousel.Carousel
點擊事件不直接對組件起作用。相反,他們在組件的元素上工作得很好。因此,對於你的情況,你可以使用它像這樣:
在控制器中的「控制」,
control : {
// Your carousel reference
"carousel" : {
initialize : function(carousel){
carousel.element.on('tap', function(e, el){
// Here you will get the target element
console.log(e.target, el);
}, this);
}
}
}
您可以使用委託這種方式,如果你想對某些類型的唯一元素的捕捉龍頭事件:
carousel.element.on('tap', function(e, el){
// Here you will get the target element
console.log(e.target, el);
}, this, {
delegate : 'div.my-element'
});
希望得到這個幫助。
非常感謝!這工作。 – Michael
嗨,我用這個代碼爲我的應用程序,但我想得到哪個點擊click.I有4個水龍頭在我的旋轉木馬。我會爲每個水龍頭創建4個js頁面。如果用戶點擊第一個水龍頭js將打開。如何我做? – tarik