$(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());
}
}
}
});