/* --------------------------------------------------------------------------------------- */ function updatePosition() { pinMenuToTop(); var scrolltop = $("body").scrollTop(); if (scrolltop==0) { scrolltop = $("html").scrollTop(); } if (scrolltop > 1000) { $("#back_to_top").css('display','block'); } else { $("#back_to_top").css('display','none'); } } function jumpToAnchor2(id) { var distanceFromTop = $("#"+id).offset().top; var realDistanceFromTop = parseInt(distanceFromTop) - 80; $('html, body').animate({ scrollTop: realDistanceFromTop }, 500); }