移动端横屏
<style>
@media all and (orientation : landscape) {
/*横屏*/
.topbar,.caption,.profile,.recommend,.plovr-error-report {
display: none !important;
}
}
</style>
<script>
function orientationChange() {
if (typeof window.orientation != 'undefined') {
if (window.orientation == 180 || window.orientation == 0) {
eleMedia.style['height'] = '181px';
eleBody.scrollTop = 0;
}
if (window.orientation == 90 || window.orientation == -90) {
setTimeout(function () {
var height = Math.max(window.screen.height, window.screen.width) * 9 / 16;
eleMedia.style['height'] = height + 'px';
eleBody.scrollTop = (window.innerHeight - height) / 2;
}, 1);
}
}
}
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () {
orientationChange();
}, false);
orientationChange();
</script>
耐得住寂寞,守得住繁华