Skip to content

Instantly share code, notes, and snippets.

@steveobbayi
Created March 31, 2016 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveobbayi/56fab1926e27ec32c4236e0fcf551031 to your computer and use it in GitHub Desktop.
Save steveobbayi/56fab1926e27ec32c4236e0fcf551031 to your computer and use it in GitHub Desktop.
window.onload=function(){
w = document.documentElement.clientWidth || document.body.clientWidth || window.innerWidth;
var targetWidth = 768;
if ( w >= targetWidth) {
//Add your javascript for screens wider than or equal to 768 here
}
else {
//Add your javascript for screens smaller than 768 here
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment