Results 1 to 2 of 2

Thread: carousel in div

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,329
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Sencha Touch widgets are best used within layouts.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

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
  •