Added Nim workshop banner to front page slider.
This commit is contained in:
parent
7b816a9fac
commit
af865cd7ae
5 changed files with 85 additions and 58 deletions
|
|
@ -4,12 +4,22 @@ var timer;
|
|||
var prevIndex = 0;
|
||||
var slideCount = 2;
|
||||
|
||||
function modifyActive(el, add) {
|
||||
var element = document.getElementById(el);
|
||||
if (add) {
|
||||
element.className = element.className + " active";
|
||||
}
|
||||
else {
|
||||
element.className = element.className.replace("active", "");
|
||||
}
|
||||
}
|
||||
|
||||
function setSlideShow(index, short) {
|
||||
if (index >= slideCount) index = 0;
|
||||
document.getElementById("slide"+prevIndex).className = "";
|
||||
document.getElementById("slide"+index).className = "active";
|
||||
document.getElementById("slideControl"+prevIndex).className = "";
|
||||
document.getElementById("slideControl"+index).className = "active";
|
||||
modifyActive("slide" + prevIndex, false);
|
||||
modifyActive("slide" + index, true);
|
||||
modifyActive("slideControl" + prevIndex, false);
|
||||
modifyActive("slideControl" + index, true);
|
||||
prevIndex = index;
|
||||
startTimer(short ? 8000 : 32000);
|
||||
}
|
||||
|
|
@ -31,4 +41,4 @@ window.onload = function() {
|
|||
slideshow.onmouseleave = slideshow_exit;
|
||||
slideCount = slideshow.children.length;
|
||||
startTimer(8000);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue