Results 1 to 4 of 4

Thread: Disable "Bounce" Effect in Carousel

  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    2
    Vote Rating
    0
      0  

    Default Disable "Bounce" Effect in Carousel

    I'm using a horizontal carousel to swipe between various teasers in our iPad app. This works really great. However I want to use this carousel in our Android app now and for this I want to disable the "bounce" effect I get when there are no more entries - meaning I'm at the end or the beginning of the "list".

    Is this possible?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The scroll config can take a config object of the Scroller class. So if you do this on a list it should work:

    Code:
    scroll : {
        bounces : false
    }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Thx - sounds promising but I can't get it working.

    Code:
    Ext.setup({
        onReady: function() {
            // Create a Carousel of Items
            var carousel1 = new Ext.Carousel({
                defaults: {
                    cls: 'card'
                },
                scroll: {
                    bounces: false
                },
                items: [{
                    html: '<h1>Carousel</h1><p>Navigate the two carousels on this page by swiping left/right or clicking on one side of the circle indicators below.</p>'
                },
                {
                    title: 'Tab 2',
                    html: '2'
                },
                {
                    title: 'Tab 3',
                    html: '3'
                }]
            });
    
            new Ext.Panel({
                fullscreen: true,
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                defaults: {
                    flex: 1
                },
                items: [carousel1 ]
            });
        }
    });
    I took this example and added the scroll part - without effect.

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default No effect with "bounces: false"

    The scroller config with bounces set to false isn't disabling the scroll bounce effect for me either on the components I've tested. Is this still supposed to work in Sencha Touch 2.x ( esp. 2.1)? Or is there another way of doing it? Thanks.

Tags for this Thread

Posting Permissions

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