mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-20 06:01:22 +08:00
website: add anchor positioning style. 4122b48f76
This commit is contained in:
@ -313,5 +313,22 @@
|
||||
|
||||
<table class="shortcuts"><thead><tr><th align="left">:-</th><th align="left">:-</th></tr></thead><tbody><tr><td align="left"><code>Up</code>, <code>Alt-k</code></td><td align="left">在流程列表中选择(突出)<code>上</code>一个流程</td></tr><tr><td align="left"><code>Down</code>, <code>Alt-j</code></td><td align="left">在流程列表中选择(突出)<code>下</code>一个流程</td></tr><tr><td align="left"><code>Left</code>, <code>Alt-h</code></td><td align="left">向<code>左</code>滚动流程列表</td></tr><tr><td align="left"><code>Right</code>, <code>Alt-l</code></td><td align="left">向<code>右</code>滚动进程列表</td></tr><tr><td align="left"><code>PgUp</code>, <code>PgDn</code></td><td align="left">将流程列表<code>向上</code>或<code>向下</code>滚动一个窗口</td></tr><tr><td align="left"><code>Home</code></td><td align="left">滚动到流程列表的<code>顶部</code> <br> <em>选择第一个流程</em></td></tr><tr><td align="left"><code>End</code></td><td align="left">滚动到流程列表的<code>底部</code> <br> <em>选择最后一个流程</em></td></tr><tr><td align="left"><code>Ctrl-A</code>, <code>^</code></td><td align="left">向<code>左</code>滚动到流程条目<code>开头</code> <em>(即行开头)</em></td></tr><tr><td align="left"><code>Ctrl-E</code>, <code>$</code></td><td align="left">向<code>右</code>滚动到流程条目<code>末尾</code> <em>(即行尾)</em></td></tr></tbody></table>
|
||||
<!--rehype:className=shortcuts-->
|
||||
</div></div></div></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang, All rights reserved.</footer></footer></body>
|
||||
</div></div></div></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang, All rights reserved.</footer></footer><script>
|
||||
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
|
||||
window.onhashchange = function () {
|
||||
anchorPoint()
|
||||
};
|
||||
}
|
||||
function anchorPoint() {
|
||||
const hash = window.location.hash?.replace(/^#/, '') || '';
|
||||
const elm = document.getElementById(decodeURIComponent(hash));
|
||||
Array.from(document.querySelectorAll('.h2wrap-body .wrap')).forEach((elm) => elm.classList.remove('active'))
|
||||
if (elm?.tagName === 'H3') {
|
||||
elm?.parentElement?.parentElement?.classList.add('active');
|
||||
const box = elm?.parentElement?.parentElement;
|
||||
console.log('elm:2', box, document.querySelectorAll('.h2wrap-body .wrap'))
|
||||
}
|
||||
}
|
||||
anchorPoint();
|
||||
</script></body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user