i want orientation to be landscape, when my website is open in mobile and it must locks on landscape.
i tried some code as below, but it is not working as desired
function rotate(degrees) {
$('body').css({
'-webkit-transform': 'rotate(' + degrees + 'deg)',
'-moz-transform': 'rotate(' + degrees + 'deg)',
'-ms-transform': 'rotate(' + degrees + 'deg)',
'transform': 'rotate(' + degrees + 'deg)'
});
};
$(window).on("orientationchange", function(event) {
if (window.orientation == 0) {} else {
rotate(-90);
}
});
$(window).orientationchange();