-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMS~1.JS
More file actions
42 lines (30 loc) · 1020 Bytes
/
CMS~1.JS
File metadata and controls
42 lines (30 loc) · 1020 Bytes
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
(function() {
document.addEventListener("DOMContentLoaded", init,false)
function init(){
var sheet = document.getElementsByClassName('changeCSS');
for (var i = 0; i <sheet.length; i++) {
sheet[i].addEventListener("click",switch_css, false); }
var links = document.getElementsByClassName('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener("click", changeContent, false);
}
}
function switch_css(){
var head = document.getElementsByTagName('head')[0];
fileName=this.id;
head.getElementsByTagName('link')[0].href=fileName;
}
function displayMessage (){
// Here display the message when loading
// Or maybe display an error message
}
function changeContent (fileName){
// Check the file exists and
// Load the file then
// Display the file
switch(this.id){
case "1":
break;
}
}
})()