2011-01-10 106 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')缺少'.'将选项卡标记为类。这是一个错误 - 可能更多。

在下次发帖之前,请先帮助我们自己并格式化代码。