-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmessages.js
36 lines (28 loc) · 883 Bytes
/
messages.js
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
var up_button = document.getElementById("img_messages2");
var down_button = document.getElementById("img_messages3");
var messages = document.getElementById("messages");
// var form1=document.getElementById('form1');
if (messages) {
messages.onclick = function () {
messages.style.position = "relative";
messages.style.top = "43%";
};
}
//scroll to top button
window.onload = function() {
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {
scrollFunction();
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
mybutton.onclick = function() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
};
};