weblinc/media-match

What about on dom ready? Shouldn't the "test" be ran then too?

jfrux opened this issue · 2 comments

I think it would be cool if we could trigger it on dom ready as well... for setting up things based on a particular width or whatever

@joshuairl

Sorry for delay. I answered this question but my comment seemed to have not been saved.

Since this is a polyfill for native matchMedia, I think the initial test for availability of matchMedia should be run asap.
If you want to wrap a media query test like matchMedia('(min-width: 800px)') in a dom ready function, go for it.

What is the use case you have in mind?

Closing due to lack of response and question seems to be answered.