Created
July 3, 2019 07:16
-
-
Save Archie22is/12b0e942c46343c79ffed4ff28be78e8 to your computer and use it in GitHub Desktop.
Handing $(window).resize() and orientation change using jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('resize', function () { | |
myFunction('resize'); | |
}); | |
window.addEventListener("orientationchange", function() { | |
myFunction('orientation'); | |
}); | |
function myFunction(value) { | |
if (value == 'resize') { | |
// do something | |
} else if (value == 'orientation') { | |
// do something else | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment