Template:UCSF/Header

From 2010.igem.org

(Difference between revisions)
Line 29: Line 29:
font-size:10px;
font-size:10px;
margin-left:16px;
margin-left:16px;
 +
}
 +
 +
.extraextraindent{
 +
text-indent:24px;
 +
font-size:10px;
 +
margin-left:24px;
}
}
Line 71: Line 77:
         z.id='tocDIV';
         z.id='tocDIV';
         var bodycon = document.getElementById('Main');
         var bodycon = document.getElementById('Main');
-
var toBeTOCced = getElementsByTagNames('h3,h4,h5',bodycon);
+
var toBeTOCced = getElementsByTagNames('h2,h3,h4,h5',bodycon);
if (toBeTOCced.length < 2) return false;
if (toBeTOCced.length < 2) return false;
Line 83: Line 89:
z.appendChild(tmp);
z.appendChild(tmp);
                 z.appendChild(document.createElement('br'));
                 z.appendChild(document.createElement('br'));
-
if (toBeTOCced[i].nodeName == 'H4')
+
if (toBeTOCced[i].nodeName == 'H3')
tmp.className += ' indent';
tmp.className += ' indent';
-
if (toBeTOCced[i].nodeName == 'H5')
+
if (toBeTOCced[i].nodeName == 'H4')
tmp.className += ' extraindent';
tmp.className += ' extraindent';
 +
if (toBeTOCced[i].nodeName == 'H5')
 +
tmp.className += ' extraextraindent';
var headerId = result[1];
var headerId = result[1];
tmp.href = '#' + headerId;
tmp.href = '#' + headerId;
toBeTOCced[i].id = headerId;
toBeTOCced[i].id = headerId;
-
if (toBeTOCced[i].nodeName == 'H2') {
 
-
tmp.innerHTML = 'Top';
 
-
tmp.href = '#top';
 
-
toBeTOCced[i].id = 'top';
 
-
}
 
}
}
return y;
return y;

Revision as of 06:48, 10 October 2010