Detect change in orientation using javascript

后端 未结 8 1301
鱼传尺愫
鱼传尺愫 2020-11-27 04:37

Is it possible to detect change in orientation of the browser on the iPad or Galaxy Tab using javascript? I think it\'s possible using css media queries.

8条回答
  •  一整个雨季
    2020-11-27 05:07

    window.orientation is what you're looking for. there's also an onOrientationChange event works for android, iphone and, i'm mostly sure, for ipad

提交回复
热议问题