他の PHP ファイルを使用して外部コンテンツをロードする PHP ページがあります。私はインクルードを使用しているので、かなりシンプルなはずです。削除した scrollTo 関数 (以下) がありました。しかし、これを行って以来、メイン ページをリロードすると、URL がすべてのハッシュ マークに非常に速くスクロールし、最後のセクションで終わることがわかります。
どのスクリプトが原因であるかはわかりません。Chrome Elements を使用しましたが、何も表示されません。
私は過去 2 時間これを理解しようとしてきたので、これがどこから来ているのかを理解するのを助けるために、別の目が本当に必要です. ということで、じっくりご覧ください。
これが今、おかしくなっているライブ テスト ページです。
これが私が最初に持っていたJSコードで、その後削除されました
$().ready(function(){
var currentAnchor1 = null;
//Check if it has changes
if(currentAnchor1 != document.location.hash){
currentAnchor1 = document.location.hash;
//if there is not anchor, the loads the default section
if(!currentAnchor1){
query1 = "page=1";
}
else
{
//Creates the string callback. This converts the url URL/#main&id=2 in URL/?section=main&id=2
var splits1 = currentAnchor1.substring(1).split('&');
//Get the section
var page1 = splits1[0];
delete splits1[0];
var query1 = "page=" + page1;
}
//Send the petition
$.scrollTo( document.location.hash, 500, { easing:'elasout' });
}
});