Created
January 15, 2019 13:25
-
-
Save maciej-szlosarczyk/544d6150d224abe0591fe32833ea5951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function responsive() { | |
function initResponsive() {} | |
$(window).scroll(function () { | |
if (window.matchMedia("(max-width: 1024px)").matches && $(document).scrollTop() > 0) { | |
$('.main-header').addClass('u-fixed'); | |
} else { | |
$('.main-header').removeClass('u-fixed'); | |
} | |
}); | |
$(window).resize(function () { | |
initResponsive(); | |
}); | |
$(document).ready(function () { | |
initResponsive(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment