2013-08-12 24 views
0

在我的Sencha應用程序中,我使用iframe顯示網頁。當我滾動iframe的內容時,它的容器面板也在滾動。由於它有時iframe不能正確滾動。是否需要更改iframe或panel的style/css ..?面板在sencha應用程序中使用iframe滾動

代碼:

Ext.define('Example.view.Dashboard', { 
     extend : "Ext.Panel", 
     alias : "widget.dashboard", 
     config : {   
     layout: 'vbox', 
     scrollable : false,        
     hideAnimation : { 
     type : "slideOut", 
     direction : 'down', 
     duration : 500 
     }, 

     showAnimation : { 
     type : "slideIn", 
     direction : 'up', 
     duration : 500 
     }, 
     }, 

     initialize : function() { 

     this.callParent(arguments); 


     var cancelButton = { 
     ui : "normal",   
     handler : this.onBackButtonTap, 
     scope : this, 
     id : 'cancelDashboardButton', 
     itemId : 'cancelDashboardButton',   
     cls : 'button-left-arrow', 
     }; 

     var topToolbar = { 
     xtype : "titlebar", 
     docked : "top", 
     cls : 'header', 
     name : 'detailToolbar', 
     title : "Dashboards", 
     itemId : 'dashboard-title', 
     items : [cancelButton] 
     }; 


     var bottomToolbar = { 
     xtype : "toolbar", 
     docked : "bottom", 
     cls : 'footer', 
     }; 

     this.add([topToolbar, 
    { 
       xtype : 'panel', 
       itemId:'webContainer', 
       flex:50, 
       html : '<div style="-webkit-overflow-scrolling:touch; height: 1000px;  overflow: auto;"><iframe src="http://www.metacube.com/" border="0" frameborder="no" style="height:100%;width:100%;"> <iframe/></div>', 
      }, 
       bottomToolbar]); 

     }, 

回答

0

也許你可以聽在嵌套iframe一個dragstart事件,然後調用處理程序的事件stopPropagation方法。這應該防止事件傳播到父容器並滾動它。

+0

我試過dragstart事件中的stopPropagation方法,但它也不起作用。 –

相關問題