私は次のorientationchange
ようにイベントをキャプチャしています:
$(window).bind( 'orientationchange', function(e){
});
の後に新しい画面の幅と高さをピクセル単位で取得するにはどうすればよいorientationchage
ですか?
試してみscreen.width
ましたが、これは変わりません。向きを変更しても、初期の幅のままです。
私は次のorientationchange
ようにイベントをキャプチャしています:
$(window).bind( 'orientationchange', function(e){
});
の後に新しい画面の幅と高さをピクセル単位で取得するにはどうすればよいorientationchage
ですか?
試してみscreen.width
ましたが、これは変わりません。向きを変更しても、初期の幅のままです。
$(window).bind( 'orientationchange', function(e){
var ori = window.orientation,
width = (ori==90 || ori==-90) ? screen.height : screen.width;
});
$(window).resizeを使用します。orientationchangeの後に実行されます
$(window).resize(function(){
//your logic
});