<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>

          Steady.js事件處理工具

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

          Steady.js 可實現(xiàn)無閃爍的 onscroll 事件處理,而不會有性能方面的損失。

          基本使用方法:

          <!DOCTYPE html>
          <html>
          <head>
            <title>Hello world!</title>
          </head>
          <body>
          
            <!-- some HTML things here -->
            
            <script type="text/javascript" src="Steady.js"></script>
            <script>
              var s = new Steady({
                conditions: {
                  "width": 400px,
                  "scrollX": 0,
                  "max-bottom": 200px
                },
                throttle: 100,
                handler: fn
              });
            
              // you cann conditions on the fly!
              s.addCondition('scrollX', 0);
            
              function fn(values, done) {
                var xhr = new XMLHttpRequest();
            
                xhr.open('GET', 'imgs.html');
                xhr.onreadystatechange = function() {
                  if ( xhr.readyState == 4 ) {
                    document.body.innerHTML += xhr.response;
                    
                    // telling Steady that we're done processing!
                    done();
                  }
                };
            
                xhr.send();
              }
            
            </script>
          </body>
          </html>
          瀏覽 30
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <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>
                  亚洲乱72 | 久久精品视频在线观看 | 六月婷婷七月丁香 | 国产探花系列ThePorn | 狼伊综合网 |