未捕获的TypeError:对象[object Object]没有方法'apply' [英] Uncaught TypeError: Object [object Object] has no method 'apply'

查看:88
本文介绍了未捕获的TypeError:对象[object Object]没有方法'apply'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我正在创建的新网站上收到此Uncaught TypeError,但我无法解决导致错误的原因。

I am receiving this Uncaught TypeError on a new website I am creating, but I can't work out what is causing the error.

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

I have recreated the issue at the link below, if you take a look at your browsers JS console you'll see the error occurring, but nothing else happens.

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

代码:

$('.newsitem').hover(
$(this).children('.text').animate({ height: '34px' }), 
$(this).children('.text').animate({ height: '0px'  }));​


推荐答案

请务必将它们包装在异步回调中:

Be sure to wrap those in asynchronous callbacks:

$('.newsitem').hover(
    function() {
        $(this).children('.title').animate({height:'34px'});
    }, function() {
        $(this).children('.title').animate({height:'0px'});
    }
);
​

这篇关于未捕获的TypeError:对象[object Object]没有方法'apply'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆