Created
October 7, 2017 17:36
-
-
Save bulini/80a191623a0f377fe950847dc32d0716 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
var offset = $("#filter-search").offset(); | |
var topPadding = 100; | |
$(window).scroll(function() { | |
if ($(window).scrollTop() > offset.top) { | |
$("#filter-search").stop().animate({ | |
marginTop: $(window).scrollTop() - offset.top + topPadding | |
}); | |
} else { | |
$("#filter-search").stop().animate({ | |
marginTop: 0 | |
}); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment