-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.js
67 lines (45 loc) · 2.21 KB
/
js.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
$(document).ready(function(){
var timelineSpan = $(".circle-timeline").find("div");
var contentTimeline = $(".content-timeline").find("p");
timelineSpan.click(function(){
var indexSpan = $(this).index();
contentTimeline.removeClass("active-content-timeline");
setTimeout(function(){
contentTimeline.eq(indexSpan).addClass("active-content-timeline");
},600)
timelineSpan.removeClass("active-timeline");
$(this).addClass("active-timeline");
console.log($(this).index());
});
contentTimeline.click(function(){
var indexSpan = $(this).index();
timelineSpan.removeClass("active-timeline");
setTimeout(function(){
timelineSpan.eq(indexSpan).addClass("active-timeline");
},400)
contentTimeline.removeClass("active-content-timeline");
$(this).addClass("active-content-timeline");
console.log($(this).index());
});
var timerTimeline = setInterval(autoTimeline,5000);
$('.timelineAboutus').hover(function(ev){
clearInterval(timerTimeline);
}, function(ev){
timerTimeline = setInterval(autoTimeline,5000);
});
function autoTimeline(){
if($(".timeline6").hasClass("active-timeline")){
timelineSpan.removeClass("active-timeline");
contentTimeline.removeClass("active-content-timeline");
timelineSpan.eq(0).addClass("active-timeline");
contentTimeline.eq(0).addClass("active-content-timeline");
}else{
var indexSpanActive = $(".line-timeline").find(".active-timeline").index();
var indexContentTimelineActive = $(".content-timeline").find(".active-content-timeline").index();
timelineSpan.removeClass("active-timeline");
contentTimeline.removeClass("active-content-timeline");
timelineSpan.eq(indexSpanActive + 1).addClass("active-timeline");
contentTimeline.eq(indexContentTimelineActive + 1).addClass("active-content-timeline");
}
}
})