-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
43 lines (33 loc) · 995 Bytes
/
script.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
$(document).ready(function(){
$('.popup-btn').click(function(){
var popupBlock = $('#'+$(this).data('popup'));
popupBlock.addClass('active')
.find('.fade-out').click(function(){
popupBlock.css('opacity','0').find('.popup-content').css('margin-top','350px');
setTimeout(function(){
$('.popup').removeClass('active');
popupBlock.css('opacity','').find('.popup-content').css('margin-top','');
}, 600);
});
});
});
var index = 0;
var slides = document.querySelectorAll(".slides");
var dot = document.querySelectorAll(".dot");
function changeSlide(){
if(index<0){
index = slides.length-1;
}
if(index>slides.length-1){
index = 0;
}
for(let i=0;i<slides.length;i++){
slides[i].style.display = "none";
dot[i].classList.remove("active");
}
slides[index].style.display= "block";
dot[index].classList.add("active");
index++;
setTimeout(changeSlide,2000);
}
changeSlide();