Supprimer scrolltotop.js
This commit is contained in:
parent
cf69129f3a
commit
970106ee8d
@ -1,24 +0,0 @@
|
|||||||
// scrolltotop.js
|
|
||||||
|
|
||||||
// Execute a function when the window is being scrolled
|
|
||||||
window.onscroll = function () { scrollFunction() };
|
|
||||||
|
|
||||||
// When the user scrolls down 20px from the top of the document, show the button
|
|
||||||
function scrollFunction() {
|
|
||||||
// Get the button
|
|
||||||
var mybutton = document.getElementById("scrollToTopButton");
|
|
||||||
|
|
||||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
|
||||||
mybutton.style.opacity = 1;
|
|
||||||
mybutton.style.visibility = "visible";
|
|
||||||
} else {
|
|
||||||
mybutton.style.opacity = 0;
|
|
||||||
mybutton.style.visibility = "hidden";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// When the user clicks on the button, scroll to the top of the document
|
|
||||||
function topFunction() {
|
|
||||||
document.body.scrollTop = 0;
|
|
||||||
document.documentElement.scrollTop = 0;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user