Skip to content

Instantly share code, notes, and snippets.

@steveobbayi
Created March 31, 2016 17:00
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/7a5d2018393a9d98eff4335dc7abf226 to your computer and use it in GitHub Desktop.
Save steveobbayi/7a5d2018393a9d98eff4335dc7abf226 to your computer and use it in GitHub Desktop.
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