r/javascript • • Aug 21 '18

Effectively supported in all browsers, JavaScript has its own form of media queries just like CSS.

https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
465 Upvotes

114 comments sorted by

View all comments

32

u/MayorMonty Aug 21 '18 edited Aug 22 '18

Huh, TIL. And to think I've been using resize events for all these years now...

Edit: scroll events are different

1

u/deadlyicon Aug 22 '18

Scroll events? Do you mean window resize events?