I\'m experiencing this problem on an iPhone device (iPhone 7, iOS 10, but also other iPhones too): in javascript, if I intercept the orientationchange event, inside the handler,
CSS can't detect the orientation change.
Use JavaScript to get the orientation change.
Add the function as
window.addEventListener("orientationchange", function() {
document.body.style.width = window.innerWidth;
});
This will add an event Handler
to window
to change the width
of body
when the orientation is changed.
More reference on orientationchange