javascript - Website reload after page orientation -


i have 1 page responsive website , don't want reload/refresh after page orientation. how can prevent this?

add piece of javascript page:

$(window).on('load', function() {     switch(window.orientation){       case -90:         contenttype = "rotated-right";       break;        case 90:         contenttype = "rotated-left";       break;     }     $('html').removeclass('rotated-left').removeclass('rotated-right').addclass('rotated-' + orientation) }); 

and css:

html.rotated-right {   transform: rotate(90deg);   -webkit-transform: rotate(90deg); }  html.rotated-left {   transform: rotate(-90deg);   -webkit-transform: rotate(-90deg); } 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -