-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1257 from Anni299/main
Added scroll-to-top arrow button
- Loading branch information
Showing
2 changed files
with
15 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,8 @@ | |
<title>Agricultural Tools Store</title> | ||
<link rel="stylesheet" href="./buy_products.css" /> | ||
<link rel="stylesheet" href="../testimonials/testimonials.css" /> | ||
<link | ||
rel="stylesheet" | ||
href="../cursor/style.css" | ||
<link | ||
href="https://unpkg.com/[email protected]/css/boxicons.min.css" | ||
rel="stylesheet" | ||
/> | ||
<link rel="stylesheet" href="../cursor/style.css" /> | ||
<link href="https://unpkg.com/[email protected]/css/boxicons.min.css" rel="stylesheet"/> | ||
<script | ||
src="https://kit.fontawesome.com/b08b6de27e.js" | ||
crossorigin="anonymous" | ||
|
@@ -649,9 +644,7 @@ <h2>Quick Links</h2> | |
</div> | ||
</footer> | ||
<div id="backtoTop"> | ||
<a href="#buy_products" | ||
><i class="bx bx-up-arrow-alt" id="go-to-top" title="Go to top"></i | ||
></a> | ||
<a href="#buy_products"><i class="bx bx-up-arrow-alt" id="go-to-top" title="Go to top"></i></a> | ||
</div> | ||
<div class="cursor"></div> | ||
<div class="cursor2"></div> | ||
|
@@ -668,11 +661,21 @@ <h2>Quick Links</h2> | |
|
||
if (scrollPosition > 300) { | ||
// Adjust this value as needed to show the button at the desired scroll position | ||
backToTopButton.style.display = "block"; | ||
backToTopButton.style.display = "flex"; | ||
} else { | ||
backToTopButton.style.display = "none"; | ||
} | ||
}); | ||
|
||
// Scroll to top when the button is clicked | ||
document | ||
.getElementById("backtoTop") | ||
.addEventListener("click", function () { | ||
window.scrollTo({ | ||
top: 0, | ||
behavior: "smooth", | ||
}); | ||
}); | ||
</script> | ||
<!-- <script src="https://mediafiles.botpress.cloud/43c4d3ec-a251-474f-8cce-3d8737805a57/webchat/config.js" defer></script> --> | ||
<script type="text/javascript"> | ||
|