未捕获的TypeError:对象[object Object]没有方法'apply'

Dav*_*ley 5 javascript jquery

我在我正在创建的新网站上收到此Uncaught TypeError,但我无法弄清楚导致错误的原因.

我在下面的链接中重新创建了这个问题,如果你看看你的浏览器JS控制台,你会看到发生错误,但没有其他事情发生.

http://jsfiddle.net/EbR6D/2/

码:

$('.newsitem').hover(
$(this).children('.text').animate({ height: '34px' }), 
$(this).children('.text').animate({ height: '0px'  }));?
Run Code Online (Sandbox Code Playgroud)

Ara*_*yan 5

一定要将它们包装在异步回调中:

$('.newsitem').hover(
    function() {
        $(this).children('.title').animate({height:'34px'});
    }, function() {
        $(this).children('.title').animate({height:'0px'});
    }
);
?
Run Code Online (Sandbox Code Playgroud)