Created
December 17, 2017 20:17
-
-
Save shehabkhan013/f7706b2dc568fbefdf9301de167f3039 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
// Check the initial Poistion of the Sticky Header | |
var stickyHeaderTop = $('#stickyheader').offset().top; | |
$(window).scroll(function(){ | |
if( $(window).scrollTop() > stickyHeaderTop ) { | |
$('#stickyheader').css({position: 'fixed', top: '0px'}); | |
$('#stickyalias').css('display', 'block'); | |
$('#stickyheader').addClass('fix-top'); | |
} else { | |
$('#stickyheader').css({position: 'static', top: '0px'}); | |
$('#stickyalias').css('display', 'none'); | |
$('#stickyheader').removeClass('fix-top'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment