When I calculate some layout positions and sizes in javascript, I always add a listener to recalculate it when user changes the window size. This way I can e.g. always keep a tile square etc.

Now I ask, is there a use case, when would user actually resize the window after the page has loaded?

The only one I can think of is changing between portrait and landscape on mobile devices. If I handle this one somehow, is there any good reason why I should bother listen to window resize?

Thanks for your ideas and responses.

  • What window, in what context? Is this a mobile app or a website? Commented Jun 12, 2014 at 15:14
  • 1
    I resize windows 1) to arange them side by side to e.g. watch a video while doing something else or taking notes of a video 2) to reduce width when reading text or viewing content 3) to layout the page (e.g. a gallery) to my taste. Then I might switch to a page that's not meant to be used with such an aspect ratio or size. I also develop web applications asking myself the same question like you. I answer them myself: users will likely change the window size, but no one would do this to watch content flying around to take the new place, so don't spend too much effort making nice animations. Commented Jun 15, 2014 at 18:05
  • Pay attention that the resizing actions doesn not occure on every resize event, use something like Underscore's throttle(). Making the content animated when resizing is something that you might add ontop if the site/application works good and you still have time. Users like me will probably be excited if present but we won't frown upon if it's missing. :) Commented Jun 15, 2014 at 18:13
  • @try-catch-finally Thank you for your use cases, that was something I was looking for! :) Commented Jun 15, 2014 at 21:54

2 Answers 2


They can do it, therefore they WILL do it. Count on it, if you want to write software that works.

I resize my browser windows (desktop PC) quite frequently for a variety of reasons.

Your webapp isn't necessarily the focus of the user's entire world.

  • I got it, but my question was more meant as "Why (when) they do it"? When do you? Commented Jun 15, 2014 at 16:56
  • When I need to pay attention to something else for a bit. That is to say, when something happens that has NOTHING to do with your app. Commented Jun 15, 2014 at 19:32

Data is a good best place to start. Window resizing behavior is easy to track. You can add a Google Analytics event to your listener and record every time someone resizes the window or changes orientation.

  • That's not the thing, I assume, people do this, but why? Commented Jun 15, 2014 at 16:54
  • "Why people do it?" is not the same question as "Why should I support it?". Commented Jun 19, 2014 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.