0

我有以下内容:

  setTimeout(function()
    $('.golden').animate({
      opacity: "1",
      top: "84px"
    }, 'slow');
  }, 1000 );

它返回Unexpected identifier

但如果我这样做:

    $('.golden').animate({
      opacity: "1",
      top: "84px"
    }, 'slow');

有用。

可能是什么问题呢?

4

2 回答 2

6

您没有正确的语法。用这个 :

   setTimeout(function() { // <= you were missing { to open the function block
    $('.golden').animate({
      opacity: "1",
      top: "84px"
    }, 'slow');
   }, 1000 );
于 2013-02-03T08:00:13.543 回答
0

语法问题

采用

setTimeout(function() 
{ $('.golden').animate({  opacity: "1", top: "84px" }, 'slow'); }, 
1000 );
于 2013-02-03T08:04:48.667 回答