-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuttonup.php
More file actions
77 lines (68 loc) · 1.42 KB
/
buttonup.php
File metadata and controls
77 lines (68 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<style type="text/css">
.menu-btn{
color: #fff;
font-size: 23px;
cursor: pointer;
display: none;
}
.whatsapp-btn{
position: fixed;
color: #fff;
height: 50px;
width: 50px;
right: 30px;
bottom: 80px;
text-align: center;
z-index: 9999;
background: green;
border-radius: 40px;
border-bottom-width: 2px;
}
.scroll-up-btn{
position: fixed;
height: 45px;
width: 42px;
background: crimson;
right: 30px;
bottom: 10px;
text-align: center;
line-height: 45px;
color: #fff;
z-index: 9999;
font-size: 30px;
border-radius: 6px;
border-bottom-width: 2px;
cursor: pointer;
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.scroll-up-btn.show{
bottom: 30px;
opacity: 1;
pointer-events: auto;
}
.scroll-up-btn:hover{
filter: brightness(90%);
}
</style>
<div class="scroll-up-btn">
<i class="fas fa-angle-up"></i>
</div>
<script>
$(document).ready(function(){
$(window).scroll(function(){
// sticky navbar on scroll script
// scroll-up button show/hide script
if(this.scrollY > 200){
$('.scroll-up-btn').addClass("show");
}else{
$('.scroll-up-btn').removeClass("show");
}
});
// slide-up script
$('.scroll-up-btn').on('click', function(){
$('body,html').animate({scrollTop: 0}, 1000);
})
});
</script>