Difference between revisions of "Template:ETH Zurich"

m
m
Line 18: Line 18:
 
var items = $("#contentContainer h2,h3,h4,h5,h6");
 
var items = $("#contentContainer h2,h3,h4,h5,h6");
 
var cur = 0,next=0;
 
var cur = 0,next=0;
 
+
var menuText = "";
 
for (i=1; i<items.length; i++) {
 
for (i=1; i<items.length; i++) {
 
next = parseInt(items[i].tagName.substring(1,2));
 
next = parseInt(items[i].tagName.substring(1,2));
 
if (next > cur) {
 
if (next > cur) {
menu.innerHTML += "<ul>";
+
menuText = menuText.concat("<ul>");
alert("new thing");
+
 
}
 
}
 
if (next < cur) {
 
if (next < cur) {
menu.innerHTML += "</ul>";
+
menuText = menuText.concat("</ul>");
alert("end thing");
+
 
}
 
}
  
 
cur = next;
 
cur = next;
menu.innerHTML += ("<li>".concat(items[i].textContent)).concat("</li>");
+
menuText = menuText.concat("<li>");
 +
menuText = menuText.concat(items[i].textContent);
 +
menuText = menuText.concat("</li>");
 
}
 
}
  
 
while (cur > 1) {
 
while (cur > 1) {
menu.innerHTML += "</ul>";
+
menuText = menuText.concat("</ul>");
 
cur = cur - 1;
 
cur = cur - 1;
 
}
 
}
 +
menu.innerHTML += menuText;
  
 
});
 
});

Revision as of 20:53, 16 August 2015

Menu

We would like to thank our sponsors