Skip to content

Instantly share code, notes, and snippets.

@giodc
Created November 27, 2016 20:20
Show Gist options
  • Save giodc/c52a424b2177e7a73f952eb2ac3c7891 to your computer and use it in GitHub Desktop.
Save giodc/c52a424b2177e7a73f952eb2ac3c7891 to your computer and use it in GitHub Desktop.
jQuery if, else, with media query
jQuery(document).ready(function () {
if (document.documentElement.clientWidth < 950) {
// do nothing below 950px
}
else
jQuery('.header-widget').css('marginTop', jQuery('.site-header').outerHeight(true) );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment