| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> |
| 6 | <meta name="apple-mobile-web-app-capable" content="yes"/> |
| 7 | <title>Carousel - prog</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','Carousel','PageIndicator']"></script> |
| 10 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, mblAlwaysHideAddressBar: true"></script> |
| 11 | |
| 12 | <script type="text/javascript"> |
| 13 | require([ |
| 14 | "dojo/ready", |
| 15 | "dijit/registry", |
| 16 | "dojox/mobile/SwapView", |
| 17 | "dojox/mobile/Carousel", |
| 18 | "dojox/mobile/CarouselItem", |
| 19 | "dojox/mobile/parser", |
| 20 | "dojox/mobile", |
| 21 | "dojox/mobile/compat" |
| 22 | ], function(ready, registry, SwapView, Carousel, CarouselItem){ |
| 23 | ready(function(){ |
| 24 | var view, item; |
| 25 | var carousel1 = new Carousel({height:"150px", navButton:true, numVisible:2, title:"Category"}, "carousel1"); |
| 26 | |
| 27 | // View #1 |
| 28 | view = new SwapView(); |
| 29 | carousel1.addChild(view); |
| 30 | |
| 31 | item = new CarouselItem({src:"images/dish1.jpg", value:"dish1", headerText:"dish1"}); |
| 32 | item.placeAt(view.containerNode); |
| 33 | |
| 34 | item = new CarouselItem({src:"images/dish2.jpg", value:"dish2", headerText:"dish2"}); |
| 35 | item.placeAt(view.containerNode); |
| 36 | |
| 37 | // View #2 |
| 38 | view = new SwapView(); |
| 39 | carousel1.addChild(view); |
| 40 | |
| 41 | item = new CarouselItem({src:"images/dish3.jpg", value:"dish3", headerText:"dish3"}); |
| 42 | item.placeAt(view.containerNode); |
| 43 | |
| 44 | item = new CarouselItem({src:"images/dish4.jpg", value:"dish4", headerText:"dish4"}); |
| 45 | item.placeAt(view.containerNode); |
| 46 | |
| 47 | carousel1.startup(); |
| 48 | }) |
| 49 | }); |
| 50 | </script> |
| 51 | </head> |
| 52 | <body style="visibility:hidden;background-color:#6D6D6D"> |
| 53 | <div id="foo" data-dojo-type="dojox.mobile.View"> |
| 54 | <div id="carousel1"></div> |
| 55 | </div> |
| 56 | </body> |
| 57 | </html> |