0

スクリプトが新しいコンテンツのajaxを実行しているときに、読み込み中のgifを追加する関数を削除しようとしていますが、スクリプトを壊し続けているので、誰かが親切に正しく編集してくれることを期待して、ここに投稿しています。 。(#loadに関係するすべてのものを取り除き、他のすべてをそのまま維持したいと思います。)

    $('#header_nav_content_container a, a.scroll_to_top, a.clear_banner, a.desire').not('.exception').click(function(){ 

    var toLoad = $(this).attr('href')+' #content';
    $('#content').hide(1555,'easeInOutQuint',loadContent);  
    $('#load').remove();
    $('body').append('<span id="load">LOADING...</span>');
    $('#load').fadeIn(888);
    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-0);
    function loadContent() {
        $('#content').load(toLoad,'',showNewContent);  
    }
    function showNewContent() {
        $('#content').show(777,'',hideLoader);
    }
    function hideLoader() {
        $('#load').fadeOut(888);
    }
    return false;

}); 

ご協力いただきありがとうございます。

4

2 に答える 2

0

わかりました。わかりました。多くの人がこれと同じスクリプト(nettutsからの「コンテンツの読み込みとアニメーション化」)を使用していることを知っているので、ここに投稿します。そのため、誰かがスクリプトの読み込み部分を取り除く方法を知りたいと思うかもしれません。

    $('#header_nav_content_container a, a.scroll_to_top, a.clear_banner, a.desire').not('.exception').click(function(){ 

    var toLoad = $(this).attr('href')+' #content';  
    $('#content').hide(1555,'easeInOutQuint',loadContent);  
    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-0);
    function loadContent() {
        $('#content').load(toLoad,'',showNewContent);  
    }
    function showNewContent() {
        $('#content').show(777,'');  //problem: I needed to remove "hideLoader"
    }
    return false;

});

みんな、ありがとう。

于 2012-11-17T04:53:44.427 に答える
0
    $('#header_nav_content_container a, a.scroll_to_top, a.clear_banner, a.desire').not('.exception').click(function(){ 

    var toLoad = $(this).attr('href')+' #content';
    $('#content').hide(1555,'easeInOutQuint',loadContent);  



    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-0);
    function loadContent() {
        $('#content').load(toLoad,'',showNewContent);  
    }
    function showNewContent() {
        $('#content').show(777,'');
    }

    }
    return false;

}); 
于 2012-11-17T04:55:51.733 に答える