mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-18 09:25:01 +00:00
Preparing to add AJAX
This commit is contained in:
parent
4c064eeaed
commit
a52f2c3da7
13 changed files with 77 additions and 55 deletions
|
@ -1,11 +1,13 @@
|
|||
button = document.getElementById("back-to-top");
|
||||
$(document).ready(function() {
|
||||
button = document.getElementById("back-to-top");
|
||||
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
|
||||
function scrollFunction() {
|
||||
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
|
||||
button.style.right = "1rem";
|
||||
} else {
|
||||
button.style.right = "-2.5rem";
|
||||
function scrollFunction() {
|
||||
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
|
||||
button.style.right = "1rem";
|
||||
} else {
|
||||
button.style.right = "-2.5rem";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue