有手机输入键盘时切换横竖屏高度变化的问题

function resetIosScreen() {
	if ( window.orientation == 90 || window.orientation == -90 ) {
 	
	        userHeight = window.screen.width;
	 	
	   } else {
	 	
	        userHeight = window.screen.height;
	 	
	    }
 	
    $(".before").height(userHeight - 70);
 	
    $(".prompt").height(userHeight);
 	
}

if (/iPhone/.test(navigator.userAgent)) {
 	
            resetIosScreen();
 	
}


 $(window).on("orientationchange",function(){
 	
                resetIosScreen();
 	
});

  

posted @ 2016-02-02 11:18  唸随爱  阅读(502)  评论(0编辑  收藏  举报