2011-01-10 118 views
0

這下面的代碼已經打破了jQuery:jQuery的動畫問題

$('.tabs li a').animate({ 
       height: '40' 
       }, 1000, function() { 
       // Animation complete. 
       }); 

       $('#tabs-wrap').animate({ 
       marginTop: '-=147' 
       }, 1000, function() { 
       // Animation complete. 
       }); 

       $('tabs li a').hover(function(){ 
        $('tabs li a').animate({ 
        height: '100'}, 1000, function(){ 
          $('#tabs-wrap').animate({ 
           marginTop: '+=147' 
          }, 1000, function(){ 

         }); 
        }); 
       }, function(){ 
        $('tabs li a').animate({ 
        height: '40'}, 1000, function(){ 
          $('#tabs-wrap').animate({ 
           marginTop: '-=147' 
          }, 1000, function(){ 

         }); 
        }); 
       }); 

我知道這看起來很亂,對不起!

任何人都可以發現什麼是錯的?

+0

什麼問題是什麼?有沒有JS錯誤?意外的結果?你能提供HTML代碼還是JSFiddle? – Dutchie432 2011-01-10 22:00:25

+0

頁面上沒有其他jQuery正在工作,這導致我認爲我在某處丟失了逗號或分號! – benhowdle89 2011-01-10 22:01:58

回答

1

$('tabs li a')缺少'.'將選項卡標記爲類。這是一個錯誤 - 可能更多。

在下次發帖之前,請先幫助我們自己並格式化代碼。