0
success: function(html){
    var halfh = html.height;
    $('#contact_'+id).show();
    $('#contact_'+id).css({'width':'90%'}).animate({
        opacity: '0.6',
        height: halfh
    }, 500 ,'linear').animate({
        opacity: '1',
    },500,'linear',function(){  <--- Error on this line
        $(this).html(html.content)
    });

注意:我将其全部更改为双引号,例如:

    opacity: "0.6",
    height: halfh
}, 500 ,"linear").animate({
    opacity:"1",
},500,"linear",function(){

但仍然是同样的错误:(

请帮忙。问候

4

3 回答 3

2

正如@soderslatt 在评论中所写,逗号有误。删除它并稍微优化您的代码。

success: function(html){
    $('#contact_' + id).show().css({'width': '90%'}).animate({
            opacity: 0.6,
            height: html.height
          }, 500, 'linear').animate({
             opacity: 1
          }, 500, 'linear', function() {
              $(this).html(html.content);
          });
}
于 2012-12-03T16:03:13.727 回答
2

就像我之前的评论一样。后面有一个逗号。

opacity:"0.6",
        height: halfh
      }, 500 ,"linear").animate({
         opacity:"1"
      },500,"linear",function(){
于 2012-12-03T16:07:46.430 回答
1
}, 500 ,'linear').animate({
   opacity:'1',  <---  Remove this comma
},500,'linear',function(){
于 2012-12-03T16:06:34.317 回答