mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
22 lines
642 B
JavaScript
22 lines
642 B
JavaScript
$( document ).ready( function () {
|
|
$( '#nav' ).load( '/nav.html' );
|
|
$( '#side-bar' ).load( '/docs/side-bar.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';
|
|
}
|
|
}; |