我怎样才能破坏这个jQuery控件绑定?

时间:2011-12-27 18:41:29

标签: jquery

我正在使用http://uniformjs.com作为我的html控件。 我们可以使用以下代码来应用它。

$("select").uniform();

如何销毁此控件绑定?

我和其他jQuery插件一样期待$("select").uniform('destroy');

4 个答案:

答案 0 :(得分:6)

试试这个:

$.uniform.restore('select');

答案 1 :(得分:1)

When cloning, it was imperative that $.uniform.restore('select'); was included, but
    var cloneCntr = 1; // Global unique counter
                //var gid = '';
          $('#cloneButton1').click(function() {
                cloneCntr++; // Increment counter
                var $clonedDiv = $(".ivsites:last").clone(true);

                            $("*", $clonedDiv).add($clonedDiv).each(function() {
                            if (this.id) {
                                this.id = this.id.substring(0, this.id.length - 1) + cloneCntr;
                             }
                            if (this.name) {
                                this.name = this.name + cloneCntr;
                            }                   
                        });


                            $clonedDiv.appendTo('#navcontainer ul:last');       
                            $.uniform.restore('select');
                            $("select").uniform();

            });

答案 2 :(得分:0)

这对我有用:

delete $.fn.pluginName;

答案 3 :(得分:-1)

看看这是否适合你:

$('select').replaceWith($('select').clone(false));