The gap between the upper and lower part of the screen switch is fixed after the mobile end

Source: Internet
Author: User

<! DOCTYPE html>

<meta charset= "UTF-8" >
<title>Document</title>
<meta name= "viewport" content= "width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1" >
<style>
Body {}

Header {
position:fixed;
width:100%;
HEIGHT:15VW;
top:0;
/*left:0;*/
background:red;
}

. box {
WIDTH:40VW;
margin:0 Auto;
}

@media all and (orientation:portrait) {
#hengping {
Display:none!important;
}
}
/* Style of device horizontal screen */

@media all and (Orientation:landscape) {
#hengping {
Display:block!important;
}
}

#hengping {
Display:none;
Background:black;
position:fixed;
left:0;
/* right:0;*/
bottom:0;
/*top:0;*/
z-index:9999;
width:100%;
height:100%;
Overflow:hidden;
}
</style>

<body>
<div id= "Hengping" ></div>
<div class= "box" >
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto Unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architectoNihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto unde ratione aspernatur in Ipsam Nemo doloribus cum architecto nihil minus! Reprehenderit Perspiciatis Accusamus, Provident Odio facere Dolores Asperiores Dolorem, Sint.
</div>
</body>
<script src= "Jquery.js" ></script>
<script>
Screen reminder
(function transverse () {
if (window.orientation = = | | window.orientation = =-90) {
var t=$ (window). scrolltop ()
$ (' #hengping '). Hide ();
SetTimeout (function () {
$ (window). scrolltop (t+1);
Horizontal screen
$ (' #hengping '). Show ();

} else if (window.orientation = = | | window.orientation = = 0) {
Vertical screen
var t=$ (window). scrolltop ()
$ (' #hengping '). Hide ();
SetTimeout (function () {
$ (window). scrolltop (t+1);

},2000)
}
Window.addeventlistener ("Onorientationchange" in Window?) "Orientationchange": "Resize", transverse, false);
})();
</script>

<!--iOS has a problem with Android testing several units without this problem--

The gap between the upper and lower part of the screen switch is fixed after the mobile end

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.