From 0a33eb0ed0fffda1e3f6af61e425c2444165fcd5 Mon Sep 17 00:00:00 2001
From: muskan shaikh
Date: Sat, 3 Oct 2020 15:18:06 +0530
Subject: [PATCH] added scrolltotop function and changes font style
---
app.js | 20 ++++++++++++++++++++
index.html | 4 +++-
style.css | 38 +++++++++++++++++++++++++++++++++++---
3 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/app.js b/app.js
index d5591aea..8ac3263c 100644
--- a/app.js
+++ b/app.js
@@ -23,3 +23,23 @@ menu_item.forEach((item) => {
mobile_menu.classList.toggle('active');
});
});
+
+var mybutton = document.getElementById("back2Top");
+
+
+window.onscroll = function() {scrollFunction()};
+
+function scrollFunction() {
+ if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
+ mybutton.style.display = "block";
+ } else {
+ mybutton.style.display = "none";
+ }
+}
+
+// When the user clicks on the button, scroll to the top of the document
+function topFunction() {
+ document.body.scrollTop = 0;
+ document.documentElement.scrollTop = 0;
+}
+
diff --git a/index.html b/index.html
index 6624159e..6fb92dd0 100644
--- a/index.html
+++ b/index.html
@@ -212,6 +212,8 @@ Your Complete Web Solution
+➤
+