I am attaching a listener to the orientationchange event:
window.addEventListener(\'orientationchange\', function () {
console.log(window.innerHeight);
}
I solved this issue combining a couple of the above solutions. Resize would fire 4-5 times. Using .one, it fired too early. A short time out added to Christopher Bull's solution did the trick.
$(window).on('orientationchange', function () {
$(window).one('resize', function () {
setTimeout(reference_to_function, 100);
});
});