<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          OnOff極小的 JavaScript 庫(kù)

          聯(lián)合創(chuàng)作 · 2023-09-22 10:15

          OnOff 是個(gè)極小的 JavaScript 庫(kù),提供 on(), off() 和 trigger() 事件管理函數(shù)。同時(shí)還包括一個(gè)非常方便的 once() 函數(shù),事件只能調(diào)用一次。

          示例:

          > // Create an instance of OnOff()
          > EventManager = new OnOff(); // NOTE: "new" is actually optional
          > // A little test function:
          > var testFunc = function(args) { console.log('args: ' + args + ', this.foo: ' + this.foo) };
          > // Call testFunc() whenever "test_event" is triggered:
          > EventManager.on("test_event", testFunc);
          > // Fire the test_event with 'an argument' as the only argument:
          > EventManager.trigger("test_event", 'an argument');args: an argument, this.foo: undefined
          > // Remove the event so we can change it:> EventManager.off("test_event", testFunc);
          > // Now let's pass in a context object:> EventManager.on("test_event", testFunc, {'foo': 'bar'});
          > // Now fire it just like before> EventManager.trigger("test_event", 'an argument');args: an argument, this.foo: bar


          瀏覽 25
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  免费黄AA| 成人视频自拍偷拍 | 日韩天天操 | 亚洲天堂视频在线播放 | 最新后入持续输出网址 |