1) Set vertical screen/horizontal screen
@media screen and (orientation:portrait) {...}
@media screen and (orientation:portrait) {
. A. b{position:static;clear:both;float:right;padding-top:5px;}
. A a.c{float:left;margin:0 0 0 5px;padding:0;width:65%;}
. A. B. d{position:static;}
}
@media screen and (Orientation:landscape) {...}
@media screen and (Orientation:landscape) {
. A. b{position:static;clear:both;float:right;padding-top:5px;}
. A a.c{float:left;margin:0 0 0 5px;padding:0;width:65%;}
. A. B. d{position:static;}
}
2) Screen pixel transform
Page size Changes
$ (window). Resize (function () {
...
});
Horizontal screen vertical screen toggle Change
$ (window). bind (' Orientationchange ', function (e) {
...
});
Determine whether the screen is currently horizontal or vertical:
if (window.orientation = = | | window.orientation = =-90) {...}
ipad,iphone vertical screen,andriod Horizontal screen
if (window.orientation = = 0 | | window.orientation = = 180) {...}
ipad,iphone horizontal screen;andriod Vertical Screen
Mobile device Vertical screen/horizontal screen