jQuery スクロールをセットアップしましたが、デュレーションが正しく機能しません。Wordpress サイトの「ページについて」で、jQuery を使用して、写真をクリックすると適切な div までスクロールできるようにしたいと考えています。スクロールは機能していますが、期間は機能していません。スクロールには 1 秒あたり約 1/4 の時間がかかり、持続時間をどの速度に設定しても問題ありません。私が参照しているサイトは、http: //teamcoding.ca/corporate/about-test/で見ることができます。
以下は、jQuery スクロールのソース コードです。
$(function(){
$('a[href*=.staff_photos_indiv]').click(function() {
if (location.pathname.replace(/^\//,") == this.pathname.replace(/^\//,") && location.hostname == this.hostname) {
var $target = $target;
$target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, {easing:'easeInOutExpo',duration:1600});
return false;
}
}
});
});