最近作hybrid app項目,碰到android有的4.1以上版本會沒有orientationchange效果,用了一種hack,利用window的resize來模擬,貌似暫時解決了問題:android
var supportsOrientationChange = "onorientationchange" in window, orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; window.addEventListener(orientationEvent, function() { //這裏寫邏輯 }, false);