Skip to content

Instantly share code, notes, and snippets.

@andershaig
Created June 11, 2012 19:15
Show Gist options
  • Select an option

  • Save andershaig/2912082 to your computer and use it in GitHub Desktop.

Select an option

Save andershaig/2912082 to your computer and use it in GitHub Desktop.
Add Page Classes
function checkWidth() {
var iframeWidth = $(window).width();
if (iframeWidth > 700) {
$('body').addClass('is_timeline');
} else {
$('body').removeClass('is_timeline');
}
};
// Event listener for resize
$(window).resize( function () {
checkWidth();
});
// Call on load
$(document).ready( function () {
checkWidth();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment