Template:UCSF/Header

From 2010.igem.org

(Difference between revisions)
Line 82: Line 82:
for (var i=0;i<toBeTOCced.length;i++) {
for (var i=0;i<toBeTOCced.length;i++) {
var tmp = document.createElement('a');
var tmp = document.createElement('a');
-
alert(toBeTOCced[i].lastChild.innerHTML);
+
var result = toBeTOCced[i].lastChild.innerHTML;
-
tmp.innerHTML = toBeTOCced[i].lastChild.innerHTML;//result[1];
+
tmp.innerHTML = result;
tmp.className = 'page';
tmp.className = 'page';
z.appendChild(tmp);
z.appendChild(tmp);
Line 93: Line 93:
if (toBeTOCced[i].nodeName == 'H5')
if (toBeTOCced[i].nodeName == 'H5')
tmp.className += ' extraextraindent';
tmp.className += ' extraextraindent';
-
var headerId = result[1];
+
var headerId = result;
tmp.href = '#' + headerId;
tmp.href = '#' + headerId;
toBeTOCced[i].id = headerId;
toBeTOCced[i].id = headerId;

Revision as of 07:15, 10 October 2010