Skip to content

Instantly share code, notes, and snippets.

@demogar
Created June 8, 2011 16:53
Show Gist options
  • Select an option

  • Save demogar/1014817 to your computer and use it in GitHub Desktop.

Select an option

Save demogar/1014817 to your computer and use it in GitHub Desktop.
responsive design con adapt.js
<script>
// Responsive design with adapt.js
function resize_callback(i, width) {
if (i > -1) {
if (i == 0)
$("body").removeClass().addClass("mobile");
else if (i == 1)
$("body").removeClass().addClass("tablet");
else if (i == 2 || i == 3)
$("body").removeClass().addClass("regular");
}
}
var ADAPT_CONFIG = {
path: 'css/',
callback: resize_callback,
dynamic: true,
range: [
'0px to 760px = mobile.css',
'760px to 980px = 720.css',
'980px to 1920px = 960.css',
'1920px = 960.css'
]
};
</script>
<script src="js/adapt.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment