Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//EnhanceJS (enhancejs.googlecode.com)
//Quick idea for loading CSS depending on Screen resolution with EnhanceJS.
//Smart phones that pass capabilities tests would get mobile.css
//enhance page based on capabilities and serve different CSS based on screen resolution
enhance({
loadStyles: screen.availWidth < 500 ? ['css/mobile.css'] : ['css/screen.css']
});
/*
result:
- newer desktop browsers get screen.css
- iPhone gets mobile.css.
- older browsers, bag phones get basic.css
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.