All you have to do is include responsif.js and responsifjs.css. Seriously!
When the script fires, or the page resizes, the classes on the body tag switch to either .responsive_desktop, .responsive_mobile, or .responsive_tablet.
No problem! Want to load something only for desktop users? Try this:
$('document').ready(function () {
var state_test = responsive.run_test();
if (state_test === 'desktop') {
// Load that desktop stuff!
}
});
Or, let’s say you want to move the navigation around? Try this:
$('document').ready(function(){
window.onresize = function () {
if ($('body').is('.responsive_desktop, .responsive_tablet')) {
// Move your navigation for desktop and tablet users
} else {
// Move your navigation for mobile users
}
};
});