Fixed website banner HTML & Javascript
Various website CSS improvements Added docs & learn icons Added learn articles
This commit is contained in:
parent
5f54ccf0bd
commit
0b2a63b7bd
11 changed files with 220 additions and 213 deletions
34
web/assets/index.js
Normal file
34
web/assets/index.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"use strict";
|
||||
|
||||
var timer;
|
||||
var prevIndex = 0;
|
||||
var slideCount = 2;
|
||||
|
||||
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";
|
||||
prevIndex = index;
|
||||
startTimer(short ? 8000 : 32000);
|
||||
}
|
||||
|
||||
function nextSlide() { setSlideShow(prevIndex + 1, true); }
|
||||
function startTimer(t) { timer = setTimeout(nextSlide, t); }
|
||||
|
||||
function slideshow_enter() { clearTimeout(timer); }
|
||||
function slideshow_exit () { startTimer(16000); }
|
||||
|
||||
function slideshow_click(index) {
|
||||
clearTimeout(timer);
|
||||
setSlideShow(index, false);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
var slideshow = document.getElementById("slideshow");
|
||||
slideshow.onmouseenter = slideshow_enter;
|
||||
slideshow.onmouseleave = slideshow_exit;
|
||||
slideCount = slideshow.children.length;
|
||||
startTimer(8000);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue