forked from Shubham8287/notice
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jj.js
55 lines (44 loc) · 1.45 KB
/
jj.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
// Slider
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
var y = document.getElementsByClassName("qw");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
y[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) { myIndex = 1 }
x[myIndex - 1].style.display = "block";
setTimeout(carousel, y[myIndex-1].innerHTML*1000); // Change image every 2 seconds
}
var myIndexTwo = 0;
carouselTwo();
function carouselTwo() {
var i;
var x = document.getElementsByClassName("imp-txt");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndexTwo++;
if (myIndexTwo > x.length) { myIndexTwo = 1 }
x[myIndexTwo - 1].style.display = "block";
setTimeout(carouselTwo, 2000); // Change image every 2 seconds
}
//FullScreen
function launchIntoFullscreen(element){
if(element.requestFullScreen){
element.requestFullScreen();
} else if(element.mozRequestFullScreen){
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen){
element.webkitRequestFullScreen();
} else if(element.msRequestFullScreen){
element.msRequestFullScreen();
}
}
launchIntoFullscreen(document.documentElement);