How can I hook into a browser window resize event?
There\'s a jQuery way of listening for resize events but I would prefer not to bring it into my project for just t
First off, I know the addEventListener method has been mentioned in the comments above, but I didn't see any code. Since it's the preferred approach, here it is:
addEventListener
window.addEventListener('resize', function(event){ // do stuff here });
Here's a working sample.