I have a script that runs based on screensize using
if (document.documentElement.clientWidth >= 1024) {//script}
This works fine, but requires a refresh between changes, as this will be used on a mobile website I need to see if the orientation changes.
How can i get this to detect the screensize without refreshing?
Try this:
Update:
You can use
orientationchangeevent: