猿问

jquery的插件如何获取对象的名字?

jquery的插件如何获取对象的名字呢?
html调用我是这样写的:

插件我是这样写的:

  •  




慕斯709654
浏览 1163回答 3
3回答

繁花如伊

(function ($) {$.extend($.fn, {drag: function (dragElement, isPaste, showMask) {var&nbsp;ieVersion = (function () {var undef,v = 3,div = document.createElement('div'),all = div.getElementsByTagName('i');while (div.innerHTML = '<!--[if gt&nbsp;IE&nbsp;' + (++v) + ']><i></i><![endif]-->',all[0]);return v > 4 ? v : undef;}());var $this = $(this).eq(0);var $drg = $(dragElement).eq(0);}

慕工程0101907

12345678//&nbsp;我想你是想得到选择器吧alert($('aaa').selector);&nbsp;//&nbsp;弹出aaa&nbsp;(function($){&nbsp;&nbsp;&nbsp;&nbsp;$.fn.rolling&nbsp;=&nbsp;function&nbsp;()&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(this.selector);&nbsp;&nbsp;&nbsp;&nbsp;};});
随时随地看视频慕课网APP
我要回答