Pashtetuum commited on
Commit
057eaf5
·
verified ·
1 Parent(s): 1d2606d

Update О-проекте.html

Browse files
Files changed (1) hide show
  1. О-проекте.html +44 -1
О-проекте.html CHANGED
@@ -19,7 +19,50 @@
19
 
20
 
21
 
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <script type="application/ld+json">{
24
  "@context": "http://schema.org",
25
  "@type": "Organization",
 
19
 
20
 
21
 
22
+ <style>
23
+ /* Стили для кнопки */
24
+ #scrollBtn {
25
+ position: fixed;
26
+ bottom: -60px; /* Начальное положение кнопки вне экрана */
27
+ right: 20px;
28
+ z-index: 99;
29
+ cursor: pointer;
30
+ width: 50px; /* Ширина изображения */
31
+ height: 50px; /* Высота изображения */
32
+ border-radius: 50%; /* Сделаем изображение круглым */
33
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Добавляем тень для кнопки */
34
+ transition: bottom 0.3s ease; /* Плавное изменение положения */
35
+ }
36
+ #scrollBtn img {
37
+ width: 100%;
38
+ height: 100%;
39
+ border-radius: 50%;
40
+ }
41
+ </style>
42
+ </head>
43
+ <body>
44
+
45
+ <!-- Сама кнопка с изображением -->
46
+ <a href="#" id="scrollBtn" title="Прокрутить к началу страницы">
47
+ <img src="images/strelka.png" alt="Стрелка">
48
+ </a>
49
+
50
+ <script>
51
+ // Показываем кнопку при прокрутке страницы
52
+ window.onscroll = function() {scrollFunction()};
53
+ function scrollFunction() {
54
+ if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
55
+ document.getElementById("scrollBtn").style.bottom = "20px"; // Плавное появление кнопки
56
+ } else {
57
+ document.getElementById("scrollBtn").style.bottom = "-60px"; // Скрытие кнопки
58
+ }
59
+ }
60
+ // Прокручиваем страницу к началу при клике на кнопку
61
+ document.getElementById("scrollBtn").onclick = function() {
62
+ document.body.scrollTop = 0; // Для поддержки старых браузеров
63
+ document.documentElement.scrollTop = 0; // Для современных браузеров
64
+ }
65
+ </script>
66
  <script type="application/ld+json">{
67
  "@context": "http://schema.org",
68
  "@type": "Organization",