-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutUs.js
49 lines (48 loc) · 917 Bytes
/
AboutUs.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
const a=document.querySelectorAll(".slider");
var b=document.getElementById('bar-percent1');
var c=document.getElementById('bar1');
var e=document.getElementById('bar-percent2');
var f=document.getElementById('bar2');
var g=document.getElementById('bar-percent3');
var h=document.getElementById('bar3');
c.style.width=b.innerText;
f.style.width=e.innerText;
h.style.width=g.innerText;
var count=0;
a.forEach(
(slider,index) =>
{
slider.style.left=`${index*100}%`
}
)
console.log(a.length);
const Prev=()=>
{
if(count!=0){
count--
sliderrun()
}
else{
count=a.length-1;
sliderrun();
}
}
const Next=()=>
{
if(count!=a.length-1){
count++
sliderrun()
}
else{
count=0;
sliderrun()
}
}
const sliderrun=()=>
{
a.forEach(
(slider)=>{
slider.style.transform =`translateX(-${count*100}%)`
}
)
}