相关疑难解决方法(0)

jquery - 不是函数错误

这是我的代码:

(function($){
    $.fn.pluginbutton = function (options) {
        myoptions = $.extend({ left: true });
        return this.each(function () {
            var focus = false;
            if (focus === false) {
                this.hover(function () {
                    this.animate({ backgroundPosition: "0 -30px" }, { duration: 0 });
                    this.removeClass('VBfocus').addClass('VBHover');
                }, function () {
                    this.animate({ backgroundPosition: "0 0" }, { duration: 0 });
                    this.removeClass('VBfocus').removeClass('VBHover');
                });
            }
            this.mousedown(function () {
                focus = true
                this.animate({ backgroundPosition: "0 30px" }, { duration: 0 });
                this.addClass('VBfocus').removeClass('VBHover');
            }, function () {
                focus = false;
                this.animate({ backgroundPosition: …
Run Code Online (Sandbox Code Playgroud)

jquery function

41
推荐指数
3
解决办法
21万
查看次数

jquery:未捕获TypeError:$(...).错误不是函数

我在我的页面上使用jquery,并没有其他部分的问题.即使$ .post和$ .get也能正常工作.

现在我正在尝试评估图像是否有任何问题并尝试此代码:

$("#bib").error(function(){
   //nothing now 
});
Run Code Online (Sandbox Code Playgroud)

我想知道为什么我得到这个错误:

Uncaught TypeError: $(...).error is not a function
at app.js:53
(anonymous) @ app.js:53
Run Code Online (Sandbox Code Playgroud)

如你所见,我缩短了代码以隔离问题,但你得到了全部的想法.目前,这些jquery源包含在页面内:

https://code.jquery.com/jquery-3.1.0.min.js https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js

知道为什么会这样吗?

jquery

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

jquery ×2

function ×1