jQuery插件开发详细教程

2020-05-23 06:07:12易采站长站整理

                    });
                // If the plugin hasn’t been initialized yet
                if (!data) {
                    /*
                     Do more setup stuff here
                     */
                    $(this).data(‘tooltip’, {
                        target: $this,
                        tooltip: tooltip
                    });
                }
            });
        },
        destroy: function () {
            return this.each(function () {
                var $this = $(this),
                    data = $this.data(‘tooltip’);
                // Namespacing FTW
                $(window).unbind(‘.tooltip’);
                data.tooltip.remove();
                $this.removeData(‘tooltip’);
            })
        },
        reposition: function () {
            // …
        },
        show: function () {
            // …
        },
        hide: function () {