2010-10-13 29 views
0

好,我嘗試加載我的網站。內容jQuery的,當我運行它本地,它顯示smoth和漂亮但是當我測試它的主機上服務器,動畫太慢的削減 ...和「加載欄」顯示不出來...:SjQuery的loadpage慢 - 動畫剪輯

You can check it out here...

這裏是我的代碼,如果ü需要的東西否則請向我

$(document).ready(function() { 

    var hash = window.location.hash.substr(1); 
    var href = $('.kwicksC li a , .footerContainer li a').each(function() { 
     var href = $(this).attr('href'); 
     if (hash == href.substr(0, href.length - 4)) { 
      var toLoad = hash + '.php .content'; 
      $('.content').load(toLoad) 
     } 
    }); 

    $('.kwicksC li a , .footerContainer li a').click(function() { 

     var toLoad = $(this).attr('href') + '.content'; 
     $('.content').fadeOut('fast', loadContent); 
     $('#load').remove(); 
     $('#mainHWrap').append('<span id="load">CARGANDO...</span>'); 
     $('#load').fadeIn('normal'); 
     window.location.hash = $(this).attr('href').substr(0, $(this).attr('href').length - 4); 

     function loadContent() { 
      $('.content').load(toLoad, '', showNewContent()) 
     } 

     function showNewContent() { 
      $('.content').fadeIn("slow", hideLoader()); 
     } 

     function hideLoader() { 
      $('#load').fadeOut('normal'); 
     } 
     return false; 
    }); 
}); 

謝謝的幫助

+0

對我來說這很順利。但是,我的個人電腦又是一個野獸。 – Marko 2010-10-13 21:06:27

回答

0

您需要這些

function loadContent() { 
     $('.content').load(toLoad,'',showNewContent()) 
    } 
    function showNewContent() { 
     $('.content').fadeIn("slow",hideLoader()); 
    } 

function loadContent() { 
     $('.content').load(toLoad,'',showNewContent) 
    } 
    function showNewContent() { 
     $('.content').fadeIn("slow",hideLoader); 
    } 

我去掉括號來改變從回調方法,因爲你叫他們instea d作爲回調傳遞給他們。

+0

對不起,這不起作用......當我這樣做時,它甚至更糟糕......但謝謝你的嘗試...... – Omegakenshin 2010-10-13 23:29:47