30 lines
698 B
JavaScript
30 lines
698 B
JavaScript
jQuery(window).scroll(function(){
|
|
if (jQuery(this).scrollTop() > 170) {
|
|
//console.log(jQuery(this).scrollTop());
|
|
jQuery('.header,#header-main').addClass('fixed-header');
|
|
}
|
|
else {
|
|
jQuery('.header,#header-main').removeClass('fixed-header');
|
|
}
|
|
});
|
|
|
|
jQuery(document).ready(function(){
|
|
jQuery('.header-container a[href^="#"],a[href^="#"]').on('click',function (e) {
|
|
e.preventDefault();
|
|
|
|
var target = this.hash;
|
|
$target = jQuery(target);
|
|
|
|
jQuery('html, body').stop().animate({
|
|
'scrollTop': $target.offset().top
|
|
}, 900, 'swing', function () {
|
|
window.location.hash = target;
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|