Line 82: | Line 82: | ||
height: 20px; | height: 20px; | ||
margin: 15px | margin: 15px | ||
+ | } | ||
+ | |||
+ | .top-fixed { | ||
+ | position: fixed; | ||
+ | top: 10px; | ||
} | } | ||
</style> | </style> | ||
Line 145: | Line 150: | ||
$window.scroll(function() { | $window.scroll(function() { | ||
if ( $window.scrollTop() >= distance ) { | if ( $window.scrollTop() >= distance ) { | ||
− | $('.navbar'). | + | $('.navbar').addClass('top-fixed'); |
console.log('on top'); | console.log('on top'); | ||
} | } |
Revision as of 09:36, 13 October 2016