点击Ext.carousel.Carousel的事件 [英] Tap event for Ext.carousel.Carousel
本文介绍了点击Ext.carousel.Carousel的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Ext.carousel.Carousel似乎没有点击事件。如何使旋转木马响应TAP事件?(点击、项目点击等)
推荐答案
点击事件不直接作用于组件。相反,它们在组件的元素上工作得很好。因此,对于您的案例,您可以这样使用它:
在控制器的"控件"中
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);
}
}
}
如果您只想在某些类型的元素上捕获点击事件,则可以通过此方式使用Delegate:
carousel.element.on('tap', function(e, el){
// Here you will get the target element
console.log(e.target, el);
}, this, {
delegate : 'div.my-element'
});
希望得到此帮助。
这篇关于点击Ext.carousel.Carousel的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文