尽管包含jquery文件,jquery easeOutBounce函数仍然缺失

时间:2012-02-03 17:33:22

标签: javascript jquery jquery-ui jquery-plugins

我使用了3个jquery相关文件,即

<script type="text/javascript" src="/blog/jquery/jquery-1.7.1.min.js"></script>
<link type="text/css" href="/blog/css/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/blog/jquery/jquery-ui-1.8.17.custom.min.js"></script>

现在我正在尝试使用Humanmsg jquery插件。它有2个jquery文件 humanmsg.js jquery.js
我已经有了最新版本的jquery,所以我没有在插件中包含jquery.js文件。现在我收到Chrome中的错误未捕获TypeError:对象#没有方法'easeOutBounce'jquery-1.7.1.min.js:4
我已经检查过这个函数是否存在于jquery-ui-1.8.17.custom.min.js中,但浏览器仍然没有从这个文件中读取,尽管显示文件错误 jquery-1.7.1.min的.js 即可。 虽然插件正在工作时,我用人类插件( jquery.js )中的脚本文件替换了orignal jquery-1.7.1.min.js 但其余的功能site取决于orignal脚本文件,因此无法替换它 任何想法(删除问题)/做法(当包括来自第三方的各种脚本文件时遵循)。 PS: humanmsg.js 使用jQuery代替$(如果它有用)。
所有脚本文件都是通过浏览器完全下载的。

以下是代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
    <script type="text/javascript" src="/var/www/blog/jquery/jquery-1.7.1.min.js"></script> <!--ORIGNAL-->
    <link type="text/css" href="/var/www/blog/css/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="/var/www/blog/jquery/jquery-ui-1.8.17.custom.min.js"></script>

    <!--script type="text/javascript" src="jquery.js"></script-->   <!--Plugin jquery file-->
    <script type="text/javascript" src="humanmsg.js"></script>
    <link href="humanmsg.css" media="screen" type="text/css" rel="stylesheet">
    <title>Humanized Messages - Demo</title>
    <script>
    jQuery(document).ready(function() {
        jQuery('a.showmessage').click(function() {
            humanMsg.displayMsg('<strong>Success:</strong> <span class="indent">You clicked \''+jQuery(this).text()+'\'</span>');
            return false;
        })

        jQuery('a.showmessage:last').click(function() {
            humanMsg.displayMsg('"Your <strong>Earth</strong> will be reduced to a burned-out cinder."');
            return false;
        })
    })
    </script>
</head>

<body>
    <p class="links">
        <a href="#" class="showmessage">Click Me to show message</a>
    </p>
</body>
</html>

编辑:


我找到了Gritter,这是humanmsg的一个很好的替代方案,并且使用最新版本的jquery工作正常。

2 个答案:

答案 0 :(得分:1)

来自插件的documentation

  

Humane Messages需要jQuery javascript库。也   建议但不是必需的是jQuery插件Easing;给   恰好反弹到动画。

他们使用的缓动插件位于http://gsgd.co.uk/sandbox/jquery/easing/,我没有看到您已将其包含在内。

答案 1 :(得分:0)

你的问题是插件,Humanmsg,is more than 4 years old,你正在使用jQuery版本1.7.1。

自1.1版以来,jQuery中已经发生了很多变化。在Humanmsg中查看,揭示了各种被取代的方法。例如,使用.bind,其中jQuery 1.7更喜欢新的.on method

你必须找到一个更新的插件,因为我不建议在今天的浏览器中使用jQuery 1.1。

你可以尝试添加缓动插件,或者just the one easing function,但是你的插件仍然有更大的问题已经过时了。