Resizing the browser window will automatically re-arrange page elements on the page, making it more easy to read them.
This eliminates sideways scrolling because elements are arranged one under another, instead of showing them one next to eachother.
The script fires before any of the content is loaded.
This is possible because most browsers check their width, then change the stylesheets accordingly.
It doesn't have to interact with any of the content at all.
If the script is placed after the stylesheets – in the <head> – then no flicker effect shows on load.
The page load and window resize event handlers use standard event listeners, so the script won't interfere with any other scripts that may run at the same time.
Requirements:
- JavaScript enabled on client side
Comments not found