当前位置: 代码迷 >> Web前端 >> Sencha Touch 判断反正屏
  详细解决方案

Sencha Touch 判断反正屏

热度:860   发布时间:2012-12-29 10:28:09.0
Sencha Touch 判断横竖屏



  Ext.Viewport.on('orientationchange',function(){
   
            var me=this,c=me.down('myCarousel');
            var screen = (window.innerWidth > window.innerHeight) ? "portrait" :"landscape";
            if(screen=='portrait'){
        	c.hide();
            }else if(screen=='landscape'){
        	c.show();
            }
            window.localStorage.setItem("screen", screen);
        })