mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
21 lines
382 B
JavaScript
21 lines
382 B
JavaScript
|
var topbutton = document.getElementById('toTop');
|
||
|
|
||
|
if (topbutton !== null) {
|
||
|
|
||
|
topbutton.style.display = 'none';
|
||
|
window.onscroll = function() {
|
||
|
scrollFunction()
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
function scrollFunction() {
|
||
|
|
||
|
if (document.body.scrollTop > 40 || document.documentElement.scrollTop > 40) {
|
||
|
topbutton.style.display = 'block';
|
||
|
} else {
|
||
|
topbutton.style.display = 'none';
|
||
|
}
|
||
|
|
||
|
}
|