Javascript 方向改变时chrome和safari的屏幕宽度值差
当Javascript 方向改变时chrome和safari的屏幕宽度值差,javascript,google-chrome,safari,screen,orientation,Javascript,Google Chrome,Safari,Screen,Orientation,当窗口方向为-90或90时 Safariscreen.width返回方向0的值screen.width, 但是Chromescreen.width返回方向0的值screen.height 我看到了这个 $(window).bind( 'orientationchange', function(e){ var ori = window.orientation; var width = (ori==90 || ori==-90) ? screen.height : screen.wi
窗口方向为-90或90时
Safariscreen.width
返回方向0的值screen.width
,
但是Chromescreen.width
返回方向0的值screen.height
我看到了这个
$(window).bind( 'orientationchange', function(e){
var ori = window.orientation;
var width = (ori==90 || ori==-90) ? screen.height : screen.width;
});
但这只适用于狩猎。在Safari和Chrome中是否有其他方法获得相同的价值