-
Notifications
You must be signed in to change notification settings - Fork 0
/
phone.js
35 lines (29 loc) · 925 Bytes
/
phone.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
para = document.getElementById("paraforjs");
function myFunction(x) {
if (x.matches) { // If media query matches
para.style.display = "none";
}
else{
para.style.display="block"
}
}
let x = window.matchMedia("(max-width: 1147px)")
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
para1 = document.getElementById("paraforjs1");
function myFunction1(x1) {
if (x1.matches) { // If media query matches
para1.style.display = "none";
}
else{
para1.style.display="block"
}
}
let x1 = window.matchMedia("(max-width: 830px)")
myFunction1(x1) // Call listener function at run time
x1.addListener(myFunction1) // Attach listener function on state changes
function time(){
time = new Date()
document.getElementById('time').innerHTML=time;
}
setInterval(time, 1000);