2012-02-21 14 views
1

我设计了sencha touch2屏幕,然后点击添加用于animate()的jquery文件,但它无法正常工作。如何将jQuery和sencha touch2一起使用。

<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    <title>slider</title> 
    <link href="im.css" rel="stylesheet" type="text/css" />       
    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/touch/sencha-touch-designer-edition/builds/resources/css/sencha-touch.css"/> 
    <script type="text/javascript" src="http://extjs.cachefly.net/touch/sencha-touch-designer-edition/builds/sencha-touch-all-debug.js"></script> 
    <script type="text/javascript" src="designer.js"></script> 
    <script type="text/javascript" src="jquery-1.3.1.js"></script> 
     <script type="text/javascript"> 
     jQuery.noConflict(); 
      jQuery(document).ready(function(){ 
          var currentState = 1; 
          jQuery('#capimage').click(function(){ 
           if(currentState == 1){ 
        jQuery('.cover').stop().animate({width:'118px'},{queue:false,duration:160}); 
             currentState = 2; 
            } 
            else{ 
             jQuery('.cover').stop().animate({width:'5px'},{queue:false,duration:160}); 
            } 
          }); 

      }); 
     </script>  
</head> 
<body></body> 
</html> 

当我删除designer.js,它将work.Please帮助找到解决方案。

+1

你为什么要使用jQuery的动画时,煎茶有内置的动画东西?请参阅api http://docs.sencha.com/touch/2-0/#!/api/Ext.Anim – adis 2012-02-21 12:52:24

+0

@ adis我想为此使用jquery。 – dineshthamburu 2012-02-21 12:55:43

+0

使用一行代码:http://docs.sencha.com/touch/2-0/#!/api/Ext.layout.Default-cfg-animation – adis 2012-02-21 13:12:55

回答

0

你好这里是3个屏幕,滑动一个例子:

/** 
* Your app description 
*/ 
Ext.application({ 
    name: 'Slide my card', 
    // launch function 
    launch: function() { 
     Ext.create('Ext.Container', { 
      fullscreen: true, 
      layout: { 
       type: 'card', 
       animation: { 
        type: 'slide', 
        direction: 'left' 
       } 
      }, 
      items: [ 
       { 
        xtype: 'panel', 
        html: 'Card 1', 
        items : [{ 
         xtype : 'button', 
         text: 'Go to second card', 
         margin: '10 10 10 10', 
         ui : 'action', 
         handler: function() { 
          this.getParent().parent.setActiveItem(1) 
         } 
        }] 
       }, 
       { 
        xtype: 'panel', 
        html: 'Card 2', 
        items : [{ 
         xtype : 'button', 
         text: 'Go to third card', 
         margin: '10 10 10 10', 
         ui : 'action', 
         handler: function() { 
          this.getParent().parent.setActiveItem(2) 
         } 
        }] 
       }, 
       { 
        xtype: 'panel', 
        html: 'Card 3', 
        items : [{ 
         xtype : 'button', 
         text: 'Go to first card', 
         margin: '10 10 10 10', 
         ui : 'confirm', 
         handler: function() { 
          this.getParent().parent.setActiveItem(0) 
         } 
        }] 
       } 
      ] 
     }); 
    } 
}); 
+0

如何在此页面中包含jquery滑出菜单?请帮忙.. – dineshthamburu 2012-02-22 06:10:20

+0

感谢您的信息..... – dineshthamburu 2012-04-17 05:22:34

相关问题