There seems to be no tap event for Ext.carousel.Carousel. How can I make a carousel respond to tap events? (tap, itemtap etc.)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Tap events do not work on the components directly. Instead they work fine on component's element. So, for your case you can use it like this:
In your controller's "control",
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);
}
}
}
You can use delegate this way if you want to capture tap event on certain types of element only:
carousel.element.on('tap', function(e, el){
// Here you will get the target element
console.log(e.target, el);
}, this, {
delegate : 'div.my-element'
});
Hope this help.