-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
42 lines (42 loc) · 1.06 KB
/
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
var teamList = $("#teams");
var teams = [
"Hello World 2.0", "LB Dev", "Tourist Guide", "Exception", "TSU State Uni", "Keyword", "ITI", "Young Programmers", "Tous"
];
var i = 0;
var showNext = function() {
if(teams.length == 0){
return;
}
var next = Math.floor(Math.random() * teams.length);
teamList.append('<li id="team' + i + '"><span>' + teams[next] + '</span></li>');
teams.splice(next,1);
var item = teamList.find("#team" + i);
setTimeout(function(){
item.addClass("show");
setTimeout(showNext, 2000);
setTimeout(function(){
if(teams.length == 0) clearInterval(interval);
}, 3000);
}, 10);
i++;
}
var interval;
$("#overlay").click(function(){
interval = setInterval(function(){
$("body").mCustomScrollbar("scrollTo", "bottom", {scrollInertia: 80});
}, 10);
$("#overlay").fadeOut("slow", showNext);
})
$("body").mCustomScrollbar({
autoHideScrollbar: false,
scrollInertia: 60,
contentTouchScroll: true,
scrollButtons: {
enable: true
},
theme: "light",
advanced:{
updateOnContentResize: true,
updateOnBrowserResize: true
}
});