舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

微件:FixTableHeader:修订间差异

来自舰R百科
跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
第1行: 第1行:
<includeonly><script>
<includeonly><style>
#fixed-table-header {
    position: fixed;
    top: 0;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    border-width: 0;
    background-color: transparent;
    pointer-events: none;
    visibility: hidden;
}
</style><script>
window.onscroll = function() {
window.onscroll = function() {
     var tables = document.getElementsByClassName("fix-table-header");
     var tables = document.getElementsByClassName("fix-table-header");
第10行: 第22行:
                 clone = table.cloneNode(true);
                 clone = table.cloneNode(true);
                 clone.id = 'fixed-table-header';
                 clone.id = 'fixed-table-header';
                clone.style.position = 'fixed';
                clone.style.pointerEvents = 'none';
                clone.style.top = 0;
                 clone.style.width = table.style.width;
                 clone.style.width = table.style.width;
                 table.parentNode.appendChild(clone);
                 table.parentNode.appendChild(clone);
                 var rows = clone.getElementsByTagName('TR');
                 var rows = clone.getElementsByTagName('TR');
                console.log(rows);
                 for (var i = 0; i < rows.length; i++) {
                 for (var i = 0; i < rows.length; i++) {
                    console.log(i, rows[i].getElementsByTagName('TD'));
                     if (rows[i].getElementsByTagName('TD').length == 0) {
                     if (rows[i].getElementsByTagName('TD').length == 0) {
                         rows[i].style.visibility = 'visible';
                         rows[i].style.visibility = 'visible';
                         rows[i].style.pointerEvents = 'auto';
                         rows[i].style.pointerEvents = 'auto';
                        rows[i].style.backgroundColor = 'white';
                     } else break;
                     } else {
                        rows[i].style.visibility = 'hidden';
                        console.log(rows[i].style.visibility);
                    }
                 }
                 }
             }
             }
             return;
             return; // don't remove clone
         }
         }
     }
     }

2016年9月27日 (二) 17:59的版本