detectOrient ( ) {
var width = document. documentElement. clientWidth
var height = document. documentElement. clientHeight
var $wrapper = document. getElementById ( 'vhtml' )
var style = ''
if ( width >= height) {
style += 'width:' + width + 'px'
style += 'height:' + height + 'px'
style += '-webkit-transform: rotate(0) transform: rotate(0)'
style += '-webkit-transform-origin: 0 0'
style += 'transform-origin: 0 0'
console. log ( 1 )
} else {
style += 'width:' + height + 'px'
style += 'height:' + width + 'px'
style += '-webkit-transform: rotate(90deg) transform: rotate(90deg)'
style += '-webkit-transform-origin: ' + width / 2 + 'px ' + width / 2 + 'px'
style += 'transform-origin: ' + width / 2 + 'px ' + width / 2 + 'px'
console. log ( 2 )
}
$wrapper. style. cssText = style
} ,
@media screen and ( orientation: portrait) {
}
@media screen and ( orientation: landscape) {
}