Home > front end >  H5, after being forced to landscape around slippery to scroll up and down on the android, fell to sc
H5, after being forced to landscape around slippery to scroll up and down on the android, fell to sc

Time:12-12

Landscape code
 
Let the width=document. DocumentElement. ClientWidth
Let height=document. DocumentElement. ClientHeight
Let ele=document. GetElementById (' horizontal - content ')
Let style='
If (width & gt;=height) {//landscape
Style +='width:' + width + 'px; '
Style +='height:' + height + 'px; '
Style +='- its - transform: the rotate (0); The transform: the rotate (0); '
Style +='- its - transform - origin: 0 0; '
Style +='transform - origin: 0 0; '
} else {//vertical screen
Style +='width:' + height + 'px; '
Style +='height:' + width + 'px; '
Style +='- its - transform: the rotate (90 deg); The transform: the rotate (90 deg); '
Style +='- its - transform - origin:' + width/2 + 'px' + width/2 + 'px; '
='transform - origin:' style + + width/+ width/2 + 2 + 'px' 'px; '
}
Ele. Style. CssText=style

CodePudding user response:

Overflow - y: auto; Vertical screen
Overflow - x: auto; landscape
  • Related