Modernizr/Modernizr — Issue #428: Dynamic Modernizr
Author: Filirom1
Created: 2011-12-06 09:02:54+00:00
State: open

Hi,

I just did a small lib on top of Modernizr to make it dynamic.
By dynamic I mean, the possibility to change tests at run-time and being notified when tests are changed.

My use case is to unify media-queries :
- Unify touch and screen size detection (What is the difference between an iPad and a Netbook 10")
- Unify media queries detection for CSS and JS

There is also something that I find useful, it's the possibility to force some tests. For exemple if I force the `touch` test, the CSS is changed and some JS are invoked to render the `touch version` of my web-app.

The source code of my lib is here :

A live example is here : .
With the source here :
If you resize your browser, media-queries will change, some tests will be updated, and then listeners will be called to change the CSS and the images src.

What do you think of this ?
I can split the code of MobileFirster if you want some features in Modernizr.

Cheers
Romain

PS : Modernizr rocks :)