javascript - show() is undefined because of custom plugin -
i wrote plugin catch show event div_loading_page element:
(function ($) { $.each(['show'], function (i, ev) { var el = $.fn[ev]; $.fn[ev] = function () { this.each(function () { if (this.id == 'div_loading_page') { $(this).trigger(ev); return false; // break out of loop } }); //alert(this.id); el.apply(this, arguments); }; }); })(jquery);
it's working fine because of following error:
$cluetiptitle.show() undefined , cluetip jquery plugin. idea how can resolve conflict?
change:
el.apply(this, arguments);
to
return el.apply(this, arguments);
this ensure original function's return value reserved , not cause unexpected behavior
Comments
Post a Comment