wonderfan / javascript

Explore the power of HTML,CSS and JavaScript
1 stars 0 forks source link

media query callback function #33

Closed wonderfan closed 9 years ago

wonderfan commented 9 years ago

This is an awesome media query library: http://wicky.nillia.ms/enquire.js

wonderfan commented 9 years ago

One sample of using this library:

        enquire.register("screen and (min-width:768px)", {
            match : function() {
                ProductMediaManager.zoomEnabled = true;
                ProductMediaManager.initZoom();
            },
            unmatch : function() {
                ProductMediaManager.destroyZoom();
                ProductMediaManager.zoomEnabled = false;
            }
        });
wonderfan commented 9 years ago

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

Why use Modernizr? Taking advantage of cool new web technologies is great fun, until you have to support browsers that lag behind. Modernizr makes it easy for you to write conditional JavaScript and CSS to handle each situation, whether a browser supports a feature or not. It’s perfect for doing progressive enhancement easily.

wonderfan commented 9 years ago

The document: http://modernizr.com/docs/