Results 1 to 3 of 3

Thread: Prevent container swipe when carousel is swiped

  1. #1
    Sencha User
    Join Date
    Apr 2014
    Posts
    9
    Answers
    2
    Vote Rating
    0
      0  

    Default Answered: Prevent container swipe when carousel is swiped

    I have a container that contains multiple elements, and one of these elements is a carousel, I have also implemented a swipe event handler on the whole container, using something like this (on container initialize):


    Code:
    component.element.on('swipe', function (e, t) {
    // swipe logic here
    });
    so the swipe is working perfectly, however the problem is when swiping the carousel, the above code is triggered too, what I want is to trigger the swipe event handler for the container (as I did above) except if the user is swiping the carousel.

  2. Your function accepts 2 params I would start by looking into the objects which are passed there if there is something different when you swipe the container and when you swipe the carousel. By that you could decide if you want to execute the swipe logic or not.

  3. #2
    Sencha User
    Join Date
    Sep 2014
    Location
    Central Europe
    Posts
    795
    Answers
    103
    Vote Rating
    52
      0  

    Default

    Your function accepts 2 params I would start by looking into the objects which are passed there if there is something different when you swipe the container and when you swipe the carousel. By that you could decide if you want to execute the swipe logic or not.

  4. #3
    Sencha User
    Join Date
    Apr 2014
    Posts
    9
    Answers
    2
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by petr.vecera View Post
    Your function accepts 2 params I would start by looking into the objects which are passed there if there is something different when you swipe the container and when you swipe the carousel. By that you could decide if you want to execute the swipe logic or not.
    Thanks for the help, yes that solved the issue, I noticed that when swiping the carousel, e.id value is "ext-carouselindicator-1", so while swiping, if I detect the string "carousel" in e.id I simply return from the function.

Similar Threads

  1. Prevent Swipe on Carousel
    By achapman in forum Sencha Touch 1.x: Discussion
    Replies: 11
    Last Post: 20 Jun 2014, 2:02 AM
  2. Carousel tap as swipe
    By phil.fuse in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 2 Mar 2012, 8:42 AM
  3. Swipe event on Panel to trigger swipe on Carousel
    By captainill in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 31 May 2011, 3:58 PM
  4. Carousel Swipe a little Jerky
    By SoFierce in forum Sencha Touch 1.x: Discussion
    Replies: 7
    Last Post: 21 Apr 2011, 6:09 AM
  5. Carousel - click instead of swipe
    By SpikeWeb in forum Sencha Touch 1.x: Discussion
    Replies: 7
    Last Post: 15 Sep 2010, 6:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •