[JS] 跳转到锚点
//锚点滚动 $("a.anchor").click(function (e) { e.preventDefault(); $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top - 82 + "px" }, { duration: 400, easing: "linear" }); return false; }); if (window.location.hash) { // smooth scroll to the anchor id $('html, body').animate({ scrollTop: $(window.location.hash).offset().top - 82 + 'px' }, 400, 'linear'); }; $("span.trans").click(function () { $(this).toggleClass("show"); });