<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 返回值:jQueryjQuery.sub() ### *V1.5*概述 可創建一個新的jQuery副本,不影響原有的jQuery對像。 有兩個具體使用jQuery.sub()創建案例。首先是提供完全沒有破壞jQuery原有一切的方法,另一個用于幫助做jQuery插件封裝和基本命名空間。 請注意,jQuery.sub()不會做任何特殊的隔離 - 這不是它的意圖。所有關于jQuery的sub'd版本的方法將仍然指向原來的jQuery。(綁定和觸發仍將通過主jQuery的事件,數據將通過主綁定的元素的jQuery,Ajax的查詢和活動將通過主jQuery的運行,等等)。 請注意,如果你正在尋找使用這個開發插件,應首先*認真*考慮使用一些類似jQuery UI widget工廠,這兩個狀態和插件管理子方法。?[使用jQuery UI widget的一些例子](http://blog.nemikor.com/2010/05/15/building-stateful-jquery-plugins/)建立一個插件。 這種方法的具體使用情況下可以通過一些例子最好的描述。 ### 參數 #### **jQuery.sub()** ### 示例 #### 描述: 添加一個jQuery的方法,以便它不會受到外部分: ##### jQuery 代碼: ~~~ (function(){ var sub$ = jQuery.sub(); sub$.fn.myCustomMethod = function(){ return 'just for me'; }; sub$(document).ready(function() { sub$('body').myCustomMethod() // 'just for me' }); })(); typeof jQuery('body').myCustomMethod // undefined ~~~ #### 描述: 改寫一些jQuery的方法,以提供新的功能。 ##### jQuery 代碼: ~~~ (function() { var myjQuery = jQuery.sub(); myjQuery.fn.remove = function() { // New functionality: Trigger a remove event this.trigger("remove"); // Be sure to call the original jQuery remove method return jQuery.fn.remove.apply( this, arguments ); }; myjQuery(function($) { $(".menu").click(function() { $(this).find(".submenu").remove(); }); // A new remove event is now triggered from this copy of jQuery $(document).bind("remove", function(e) { $(e.target).parent().hide(); }); }); })(); // Regular jQuery doesn't trigger a remove event when removing an element // This functionality is only contained within the modified 'myjQuery'. ~~~ #### 描述: 創建一個插件,它返回插件的具體辦法。 ##### jQuery 代碼: ~~~ (function() { // Create a new copy of jQuery using sub() var plugin = jQuery.sub(); // Extend that copy with the new plugin methods plugin.fn.extend({ open: function() { return this.show(); }, close: function() { return this.hide(); } }); // Add our plugin to the original jQuery jQuery.fn.myplugin = function() { this.addClass("plugin"); // Make sure our plugin returns our special plugin version of jQuery return plugin( this ); }; })(); $(document).ready(function() { // Call the plugin, open method now exists $('#main').myplugin().open(); // Note: Calling just $("#main").open() won't work as open doesn't exist! }); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看