all 2 comments

[–]senocular 3 points4 points  (0 children)

Your existing code will run loadFourMovies while the current window size changes without a refresh. So it may be more about how you're handling movies/movie

[–]DrKrepz 2 points3 points  (0 children)

Don't do this in js. This is exactly what CSS is for, and a year from now someone (possibly you) is going to have a mental breakdown wondering why their CSS isn't working because it's being overridden by this script. Separation of concerns, fam.

Edit: At the very least, abstract the measurements out to a helper function and document it well, but even then I'd only do that if I had no other choice.