Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the scroll up button has been successfully added to the FAQs page #1615

Merged
merged 1 commit into from
Oct 30, 2024
Merged
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
22 changes: 22 additions & 0 deletions F&Q.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@
</head>
<body>
<script src="script.js"></script>
<script>

</script>
<header class="main-head">
<button class="go-top-btn">
<img height="45px" width="50px" src="arrow_upper.png " alt="arrow up">
</button>
<div class="logo">
<img src="img/logo.png" id="logo-web" />
<h1 id="logo"><a href="#home">BuddyTrail</a></h1>
Expand Down Expand Up @@ -378,6 +384,22 @@ <h2>Suggestions/Questions</h2>
modal.style.display = 'none';
}
});

const goTopBtn= document.querySelector('.go-top-btn');
window.addEventListener('scroll',checkHeight)
function checkHeight(){
if(window.scrollY > 200){
goTopBtn.style.display="flex"
} else{
goTopBtn.style.display="none"
}
}
goTopBtn.addEventListener('click', () =>{
window.scrollTo({
top:0,
behavior:"smooth"
})
})
</script>


Expand Down
Loading