web app 页面旋转整体样式问题

 $(window).bind("orientationchange", function (event) {
if (event.orientation) {
//portrait 竖屏 landscape 横屏
if (event.orientation == 'portrait') {
if (browser.versions.android) {
//安卓手机触发时间晚,设定一个延迟
setTimeout(function () { //需要变更的元素长宽
$("#contents").css("height", parseInt($(window).height() - 44));
$("#joinclub").css("width", $(window).width());
}, 300);
}
else {
$("#contents").css("height", parseInt($(window).height() - 44));
$("#joinclub").css("width", $(window).width());
}
}
else if (event.orientation == 'landscape') {
if (browser.versions.android) {
setTimeout(function () {
$("#contents").css("height", parseInt($(window).height() - 44));
$("#joinclub").css("width", $(window).width());
}, 300);
}
else {
$("#contents").css("height", parseInt($(window).height() - 44));
$("#joinclub").css("width", $(window).width());
}
}
}
});

  

上一篇:一句话总结K均值算法


下一篇:vue,vux判断字符串是否是undefined