1

There seems to be no tap event for Ext.carousel.Carousel. How can I make a carousel respond to tap events? (tap, itemtap etc.)

Michael
  • 6,823
  • 11
  • 54
  • 84

1 Answers1

4

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.

Swar
  • 5,473
  • 3
  • 31
  • 43
  • hi,I use this code for my app;but i want to get which tap click.I have 4 tap in my carousel.I will create 4 js page for every tap.If user click first tap first js will open.How can i do? – tarikfasun Nov 17 '15 at 13:25