mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-21 14:31:30 +08:00
website: add anchor positioning style. 4122b48f76
This commit is contained in:
@ -419,5 +419,22 @@
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token parameter variable">-name</span> <span class="token string">"*.java"</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">tar</span> cvf myfile.tar
|
||||
</span><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token parameter variable">-name</span> <span class="token string">"*.java"</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">tar</span> rvf myfile.tar
|
||||
</span></code></pre>
|
||||
</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