(function(){varSupportorientation = (typeofWindow.orientation = = = ' Number ' &&typeofWindow.onorientationchange = = = ' object ');varinit =function(){varHtmlnode =document.body.parentnode,orientation;varUpdateorientation =function(){if(supportorientation) {Orientation=window.orientation;Switch(orientation) { Case90: Case-90: Orientation= ' Landscape '; Break;default: Orientation= ' Portrait '; Break;}}Else{Orientation= (Window.innerwidth > Window.innerheight)? ' Landscape ': ' Portrait ';} Htmlnode.setattribute (' Class ', orientation);};if(supportorientation) {Window.addeventlistener (' Orientationchange ', updateorientation,false);}Else{//Monitoring Resize EventsWindow.addeventlistener (' Resize ', updateorientation,false);} Updateorientation ();}; Window.addeventlistener (' domcontentloaded ', init,false);}) ();
Mobile--judging the screen