Sencha Touch 2 test
reference: http://docs.sencha.com/touch/2-1/#!/guide/first_app
HTML
<link rel="stylesheet" href="http://cdn.sencha.io/touch/sencha-touch-2.1.0/resources/css/sencha-touch.css">
<script src="http://cdn.sencha.io/touch/sencha-touch-2.1.0/sencha-touch-all.js"></script>
CSS
html {
overflow: hidden
}
.home {
text-align: center;
}
.home img {
width: 64%;
}
.home h1 {
font-weight: bold;
font-size: 1.2em;
}
.home p {
color: #666;
font-size: 0.8em;
line-height: 1.5em;
margin: 10px 20px 12px 20px;
}
.home h2 {
color: #999;
font-size: 0.7em;
}
.twitterView .x-dataview-item {
padding: 10px;
min-height: 50px;
}
.twitterView .x-dataview-item img {
float: left;
display: block;
margin-top: 36px;
}
.twitterView .x-dataview-item h2 {
font-weight: bold;
color: #333;
margin: 0px 0px 10px 60px;
}
.twitterView .x-dataview-item p {
color: #666;
margin-left: 60px;
font-size: 0.8em;
}
/*used in the dataview guide*/
.my-dataview-item {
background: #ddd;
padding: 1em;
border-bottom: 1px solid #ccc;
}
.my-dataview-item img {
float: left;
margin-right: 1em;
}
.my-dataview-item h2 {
font-weight: bold;
}
JavaScript
Ext.application({
name: 'Sencha',
launch: function() {
var carousel = Ext.create('Ext.Carousel', {
id:'carouselItem',
fullscreen: true,
indicator:false,
defaults: {
styleHtmlContent: true
},
items: [
{
xtype:'container',items:[
{xtype:'button',text:'image 1 Next',height:100,
listeners:{
tap:function(){
var Carousel = Ext.getCmp('carouselItem');
var activeItemIndex = Carousel.getActiveIndex();
Carousel.setActiveItem(activeItemIndex+1);
}
}
}
]
},
{
xtype:'container',layout:'vbox',items:[
{xtype:'button',text:'image 2 Back',height:100,width:250,
listeners:{
tap:function(){
var Carousel = Ext.getCmp('carouselItem');
var activeItemIndex = Carousel.getActiveIndex();
Carousel.setActiveItem(activeItemIndex-1);
}
}
},
{xtype:'button',text:'image 2 Next',height:100,width:250,
listeners:{
tap:function(){
var Carousel = Ext.getCmp('carouselItem');
var activeItemIndex = Carousel.getActiveIndex();
Carousel.setActiveItem(activeItemIndex+1);
}
}
}
]
},
{
xtype:'container',items:[
{xtype:'button',text:'image 3 Back',height:100,
listeners:{
...