-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
95 lines (68 loc) · 2.03 KB
/
app.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// image slider
jQuery(document).ready(function ($) {
// This is for the auto sliding
setInterval(function () {
moveRight();
}, 5000);
//variables
var slideCount = $('#slider ul li').length;
var slideWidth = $('#slider ul li').width();
var slideHeight = $('#slider ul li').height();
var sliderUlWidth = slideCount * slideWidth;
$('#slider').css({ width: slideWidth, height: slideHeight });
$('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });
$('#slider ul li:last-child').prependTo('#slider ul');
function moveLeft() {
$('#slider ul').animate({
left: + slideWidth
}, 300, function () {
$('#slider ul li:last-child').prependTo('#slider ul');
$('#slider ul').css('left', '');
});
};
function moveRight() {
$('#slider ul').animate({
left: - slideWidth
}, 300, function () {
$('#slider ul li:first-child').appendTo('#slider ul');
$('#slider ul').css('left', '');
});
};
$('.control_prev').click(function () {
moveLeft();
});
$('.control_next').click(function () {
moveRight();
});
});
// Video slider
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i,
x = document.getElementsByClassName("video-slide"),
y = document.getElementsByTagName("video");
if (n > x.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = x.length
}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
y[i].pause();
}
x[slideIndex-1].style.display = "block";
}
// link - hidder
// const showClass = (e)=>{
// icons.forEach(item =>{
// return item.classList.toggle(".team-link");
// })
// }
// const icons = document.querySelectorAll(".icon");
// const images = document.querySelectorAll(".team-img");
// images.forEach(item => item.addEventListener('transitionend', showClass))