为了账号安全,请及时绑定邮箱和手机立即绑定

手机横屏问题

手机横屏问题

lyhzwf 2015-10-23 11:50:59
function orient() { var supportOrientation = (typeof window.orientation === 'number' &&            typeof window.onorientationchange === 'object'); var orientation; if(supportOrientation){        orientation = window.orientation;        switch(orientation){            case 90:            case -90:                orientation ='landscape';                               break;             default:                orientation ='portrait';                break;        }    }else{        orientation = (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';    }    if(orientation == 'landscape'){    $(".WScalet").css({"zoom":window.innerWidth/1136});            }    if(orientation == 'portrait'){        $(".WScale").css({"zoom":window.innerWidth/640});             }} //页面加载时调用 $(function(){ orient(); }); //用户变化屏幕方向时调用 $(window).bind( 'orientationchange', function(e){ orient();});我这样做为什么每次转屏后都要刷新才能正常显示
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1115 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信