-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
51 lines (40 loc) · 1.34 KB
/
index.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
var Reveal = require('reveal');
var highlight = require('highlight.js'); // Highlight code
var chartFactory = require('./js/chartFactory.js');
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
// default/cube/page/concave/zoom/linear/fade/none
transition: 'none'
});
//Bind Events
Reveal.addEventListener( 'slidechanged', chartFactory.slideChange);
Reveal.addEventListener( 'ready', chartFactory.slideChange);
//Init Highlighting
highlight.initHighlighting();
//Init Graph
require('./js/graph.js');
//Css checkbox example
var ch = document.getElementsByClassName("cssCheck");
var target = document.getElementById("cssTarget");
function handleClick(e){
var el = e.srcElement;
var prop = el.value.split(':');
if(el.checked){
target.style[prop[0]] = prop[1];
}else{
target.style[prop[0]] = null;
}
}
for(var i=0; i<ch.length; i++)
ch[i].addEventListener("click", handleClick);
//Objects in the DOM can be manipulated by JavaScript example
function changeTitle(){
var title = document.getElementById("slideTitle");
title.innerText = "See?? JS can manipulate dom objects";
}
document.getElementById("titleButton").addEventListener("click", changeTitle);