Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -494,4 +494,23 @@ body {



/* Footer Section Ends */
/* Footer Section Ends */
#scrollUp {
display: none; /* Hide the button by default */
position: fixed; /* Keep the button in place */
bottom: 20px; /* Position the button from the bottom */
right: 30px; /* Position the button from the right */
z-index: 99; /* Make sure it does not overlap other elements */
border: none; /* Remove border */
outline: none; /* Remove outline */
cursor: pointer; /* Change cursor on hover */
padding: 15px; /* Add padding */
border-radius: 10px; /* Add border-radius */
background-color: rgb(117, 116, 116); /* Add background-color */
color: white; /* Add text color */
font-size: 18px; /* Add font size */
}

#scrollUp:hover {
background-color: #666; /* Add background-color on hover */
}
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,23 @@ <h4>IEEE SSIT VIT © 2023</h4>
<script src="filter_project.js"></script>
<script src="script.js"></script>

<button id="scrollUp" onclick="scrollTopFunction()"><i class="fas fa-angle-up"></i></button>

<script>
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scrollUp").style.display = "block";
} else {
document.getElementById("scrollUp").style.display = "none";
}
}

function scrollTopFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>

</body>