$('a[href*="#"]:not([href="#"])').not('.popup-with-move-anim').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - 120
}, 1000);
return false;
}
}
});
var heightblock = $('.header').height();
$(window).scroll(function() {
if ($(this).scrollTop() >= heightblock && $('.head-line').hasClass("loading")) {
$('.head-line').removeClass("loading").addClass("scrolling");
$('a[href*="#"]:not([href="#"])').not('.popup-with-move-anim').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - 60
}, 1000);
return false;
}
}
});
} else if ($(this).scrollTop() < heightblock && $('.head-line').hasClass("scrolling")) {
$('.head-line').removeClass("scrolling").addClass("loading");
}
});