Skip to content

Instantly share code, notes, and snippets.

View Azim-Munna's full-sized avatar

Azim Munna Azim-Munna

View GitHub Profile
@ShiponKarmakar
ShiponKarmakar / Header Top Fix Function.js
Last active November 20, 2021 04:39
Jquery All Source
// 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');