Created
January 21, 2017 10:04
-
-
Save aziz-blr/2c2a262cafa3bea0a6941fdbfee0df5a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Sticky header | |
*/ | |
if ( $body.hasClass( 'header-sticky' ) ) | |
{ | |
var $topbar = $( '#topbar' ), | |
offset = $topbar.length ? $topbar.height() : 0; | |
$window.scroll( function() | |
{ //alert(offset); | |
$header = $( '#header' ), | |
if ( $window.scrollTop() >= 60 ) | |
$header.addClass( 'sticky' ); | |
else | |
$header.removeClass( 'sticky' ); | |
} ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment