foo
This commit is contained in:
29
www/htdocs/js/menu-target.js
Normal file
29
www/htdocs/js/menu-target.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user