mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
fix navbar & path highlighting
This commit is contained in:
20
website/dist/docs/js/index.js
vendored
20
website/dist/docs/js/index.js
vendored
@@ -2,4 +2,22 @@ $( document ).ready( function () {
|
||||
$( '#nav' ).load( '/nav.html' );
|
||||
$( '#side-bar' ).load( '/docs/side-bar.html' );
|
||||
$( '#footer' ).load( '/footer.html' );
|
||||
} );
|
||||
} );
|
||||
|
||||
let btn = document.getElementById( 'backToTop' );
|
||||
|
||||
function backToTop () {
|
||||
if ( document.body.scrollTop > 500 || document.documentElement.scrollTop > 500 ) {
|
||||
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
||||
}
|
||||
}
|
||||
|
||||
window.onscroll = function () {
|
||||
if ( document.body.scrollTop > 500 || document.documentElement.scrollTop > 500 ) {
|
||||
btn.style.opacity = '1';
|
||||
btn.style.cursor = 'pointer';
|
||||
} else {
|
||||
btn.style.opacity = '0';
|
||||
btn.style.cursor = 'default';
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user