jQueryでページ内のアンカーポイントまでスムーズにスクロールするスクリプトです。 スクロールのイージングには「jquery.easing.1.3.js」を利用しています。 サンプルはこちら function scrollToAnchor() { $("a[href*=#]").click(function() { var target = this.hash; var offset = $(target).offset().top; if (offset > $(document).height()-$(window).height()) { offset = $(document).height()-$(window).height(); } $("html, body").animate({scrollTop:offset}, {duration:1000, easing:"eas
![jQueryでアンカーポイントまでスクロール。 | Almondlab](https://cdn-ak-scissors.b.st-hatena.com/image/square/d3e5060ec19e954cee71b90f9b87cc855faeeb9c/height=288;version=1;width=512/https%3A%2F%2Fwww.almondlab.jp%2Fwp-content%2Fthemes%2Falmondlab2019%2Fimages%2Fog-image-default.png)