0

他の 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' });
    }
});
4

1 に答える 1

1

これはあなたのPHPページから来ています。4100.phpはインラインJavaScriptを出力しています。

<!--JavaScriptでブロックコメントに使用することはできないため、window.location呼び出しは実際に引き続き発生します。(JavaScriptの複数行のコメントの場合は、代わりにとで行を囲みます/**/

2485行目:

<script type="text/javascript">
<!--
window.location = "http://www.period3designs.com/tmss/l1/terminals/4100.php#4100errors"
//-->
</script>

4779行目:

        <script type="text/javascript">
<!--
window.location = "http://www.period3designs.com/tmss/l1/terminals/4100.php#4100guides"
//-->

5319行目:

        <script type="text/javascript">
<!--
window.location = "http://www.period3designs.com/tmss/l1/terminals/4100.php#4100howto"
//-->
</script>

5393行目:

<script type="text/javascript">
<!--
window.location = "http://www.period3designs.com/tmss/l1/terminals/4100.php#4100functions"
//-->
</script>

5467行目:

                        <script type="text/javascript">
<!--
window.location = "http://www.period3designs.com/tmss/l1/terminals/4100.php#4100menus"
//-->
</script>
于 2012-06-29T21:52:16.793 に答える