简体   繁体   English

尽管包含jquery文件,但缺少jquery easyOutBounce函数

[英]jquery easeOutBounce function missing in-spite of including jquery file

I have used 3 some jquery related files namely 我已经使用了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>

Now i am trying to use Humanmsg jquery plugin. 现在,我正在尝试使用Humanmsg jquery插件。 It had 2 jquery files humanmsg.js and jquery.js . 它有2个jquery文件humanmsg.jsjquery.js
I already have latest version of jquery so I haven't included jquery.js file from plugin. 我已经有了最新版本的jquery,所以没有包含插件中的jquery.js文件。 Now i am getting the error in Chrome Uncaught TypeError: Object # has no method 'easeOutBounce' jquery-1.7.1.min.js:4 现在我在Chrome Uncaught TypeError中遇到错误:对象#没有方法'easeOutBounce'jquery-1.7.1.min.js:4
I have checked this function to be present in jquery-ui-1.8.17.custom.min.js but still the browser is not reading from this file, in-spite showing error for file jquery-1.7.1.min.js . 我已经检查了此功能是否存在于jquery-ui-1.8.17.custom.min.js中,但浏览器仍未从该文件读取,尽管显示文件jquery-1.7.1.min.js出错 Though the plugin is working when i replace the orignal jquery-1.7.1.min.js with the script file in humanmsg plugin( jquery.js ) but rest of functionality of site depends on the orignal script file, so can't replace it. 虽然当我用humanmsg插件( jquery.js )中的脚本文件替换原始jquery-1.7.1.min.js时插件可以正常工作,但网站的其余功能取决于原始脚本文件,因此无法替换。
Any idea(to remove the problem)/practices (to follow when including various script files from 3rd party). 任何想法(消除问题)/实践(包括第三方提供的各种脚本文件时都应遵循)。 PS: humanmsg.js use jQuery instead of $ ( if it is of any use). PS: humanmsg.js使用jQuery代替$(如果有用)。
All the scripts files are downloaded completely by browser. 所有脚本文件均由浏览器完全下载。

Here is the code: 这是代码:

<!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>

EDIT: 编辑:


I have found Gritter , good alternative for humanmsg and its working fine with latest version of jquery. 我找到了Gritter ,它是humanmsg的不错选择,并且可以与最新版本的jquery配合使用。

From the documentation for your plugin: 从插件的文档中:

Humane Messages requires the jQuery javascript library. 人文信息需要jQuery javascript库。 Also recommended, but not required, is the jQuery plugin, Easing ; 还推荐但并非必需的是jQuery插件Easing to give just the right bounce to the animations. 给动画正确的跳动。

The easing plugin they use is at http://gsgd.co.uk/sandbox/jquery/easing/ which I don't see that you've included. 他们使用的easing插件位于http://gsgd.co.uk/sandbox/jquery/easing/中 ,我看不到您已包含其中。

Your problem is that the plugin, Humanmsg, is more than 4 years old and you're using jQuery version 1.7.1. 您的问题是,Humanmsg插件使用4年以上,并且您使用的是jQuery 1.7.1版。

A lot has changed within jQuery since version 1.1. 自1.1版以来,jQuery发生了很多变化。 Looking inside Humanmsg, reveals all kinds of superseded methods. 在Humanmsg内部查看,可以发现各种被取代的方法。 Using .bind , for example, where jQuery 1.7 prefers the new .on method . 例如,使用.bind ,其中jQuery 1.7首选新的.on方法

You'll have to find a more up to date plugin as I would not recommend using jQuery 1.1 with today's browsers. 您将必须找到一个更新的插件,因为我不建议在当今的浏览器中使用jQuery 1.1。

You could try adding the easing plugin, or just the one easing function , but you still have the much larger issue of your plugin being way out of date. 您可以尝试添加easing插件,或者添加一个easing函数 ,但仍然存在插件过时的更大问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM