1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
    teemu is on a distinguished road

      0  

    Default Unanswered: carousel in div

    Unanswered: carousel in div


    Hi

    I'm new with sencha and don't know how to solve my problem. I am trying to implement multiple carousels in site and I have to control them with divs. When I put carousel in div it stops working it only works fullscreen. Any help appreciated.

    I put current code down.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
           <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
           <title>Carousel</title>
           <link rel="stylesheet" href="resources/css/sencha-touch.css" type="text/css">
           <script src="3rd_party/sencha-touch-all-debug.js"></script>
    </head>
            
    <body>
          <div id="sencha4"></div>                
          <script type="text/javascript">
    
                    Ext.setup({
                        
                       requires: [
                            'Ext.carousel.Carousel',
                            'Ext.Img'
                       ],
                       onReady: function () {
                            
                       var carusel = new Ext.Carousel({
                                    title: 'Message Title',
                                    
                                    //IN DIV
                                    renderTo: 'sencha4',
                                    width: 150,                                                                    
                                    height: 100,
                                        
                                    //IN FULLSCREEN    
                                    //fullscreen: true,    
    
                                       
                                    defaults: {
                                        // applied to each contained item
                                        cls: 'card'
                                                    
                                    },
    
                                items:  [
                                            {
                                                html : 'Item 1',
                                                style: 'background-color: #5E99CC'
                                            },
                                            {
                                                html : 'Item 2',
                                                style: 'background-color: #759E60'
                                            },
                                            {
                                                html : 'Item 3'
                                            },
                                             {
                                                html : 'Item 4',
                                                style: 'background-color: #759E60'
                                            },                                        
                                            {
                                                html : 'Item 5',
                                                style: 'background-color: #5E99CC'
                                            },
                                            {
                                                html : 'Item 6',
                                                style: 'background-color: #759E60'
                                            },
                                            {
                                                html : 'Item 7'
                                            }
                                        ]
                               });
                        }
                    });
            </script>  
        </body>
    </html>

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Sencha Touch widgets are best used within layouts.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread