Posted in Javascript onDecember 20, 2011
查了不少资料,最后结论如下:
function orientationChange(){ switch(window.orientation) { case 0: // Portrait case 180: // Upside-down Portrait // Javascript to setup Portrait view break; case -90: // Landscape: turned 90 degrees counter-clockwise case 90: // Landscape: turned 90 degrees clockwise // Javascript to steup Landscape view break; } } window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", orientationChange, false);
javascript判断iphone/android手机横竖屏模式的函数
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@