prvni várka

This commit is contained in:
2024-04-17 23:13:56 +02:00
commit 25ef045289
19 changed files with 433 additions and 0 deletions

11
Go-To-Up/index.html Normal file
View File

@ -0,0 +1,11 @@
<head>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
</head>
<body>
<button onclick="scrollToTop()" id="scrollToTopBtn" title="Go to top">
<i class="fas fa-arrow-up"></i>
</button>
</body>

19
Go-To-Up/script.js Normal file
View File

@ -0,0 +1,19 @@
// Tlačítko go to top
// Zobrazení tlačítka od rolovaní části stránky (víc logické než až na konci)
window.onscroll = function () {
scrollFunction();
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scrollToTopBtn").style.display = "block";
} else {
document.getElementById("scrollToTopBtn").style.display = "none";
}
}
// Posunout nahoru, když uživatel klikne na tlačítko
function scrollToTop() {
document.body.scrollTop = 0; // Pro Safari
document.documentElement.scrollTop = 0; // Pro ostatní prohlížeče
}

14
Go-To-Up/style.css Normal file
View File

@ -0,0 +1,14 @@
/* Go to go */
#scrollToTopBtn {
display: none;
position: fixed;
bottom: 20px;
right: 20px;
/*butoon přes obsah*/
z-index: 99;
outline: none;
cursor: pointer;
padding: 15px;
border-radius: 50%;
background-color: transparent;
}