Masta
Masta

Reputation: 149

Preview next and previous carousel item

Im trying to create a carousel where, apart of the active item, the user can preview part of the next and previous items. I made a draw to illustrate it:

enter image description here

I tried things like padding or margin, but anything works.

Here's a carousel to play with: http://jsfiddle.net/XpG8v/

        Ext.Viewport.add({
        xtype: 'carousel',
        height: 300,
        width: 300,
        items: [{
            style: 'background-color: #00ffff;'
        },{
            style: 'background-color: #ff00ff;'
        },{
            style: 'background-color: #ffff00;'
        }]
    });

Thanks!

Upvotes: 2

Views: 723

Answers (1)

Jacky Nguyen
Jacky Nguyen

Reputation: 96

Simply set the 'itemLength' config to a fixed value, for example:

Ext.Viewport.add({
    xtype: 'carousel',
    itemLength: 200,
    // ...
});

Upvotes: 8

Related Questions