SyntaxFix
Write A Post
Hire A Developer
Questions
I have a simpler solution for you:
window.onload = window.onresize = (event) => { //Your Code Here }
I've tested this an it works great, on the plus side it's compact and uncomplicated like the other examples here.