Adapt.js is a lightweight JavaScript file that determines which CSS file to load before the browser renders the page. In case the browser tilts of resizes, the script checks its width and loads the needed CSS file accordingly. If JavaScript is disabled default stylesheets can be served via <noscript>
which is valid in the HEAD of HTML5.
Alternatives include: Build a separate site for mobile. Or, use media queries to adjust layout, with a polyfill for older browser support, and conditional Internet Explorer comments for Windows phones. Also a factor is how to handle multiple image resolutions without adding file size. Filament Group is advocating context aware image sizing.
- Source & Demo: http://adapt.960.gs/ (resize the page to see it in action)
- License: GPL and MIT