Closed (won't fix)
Project:
Javascript Tools
Version:
4.7.x-1.x-dev
Component:
TOC
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
20 Oct 2006 at 03:47 UTC
Updated:
2 Apr 2010 at 17:13 UTC
I tried TOC, which worked fine, but wasn't what my client wanted.
I branched my own implimentation which runs a modified version of the TOC.js to insert into a BLOCK instead of whacking it into the node body.
While I was there, I repaired the existing IE problem, by anchoring against IDs, not empty A tags.
This feedback is just an FYI. A a tiny module that supplies a block that only shows up if the document has some H2s in it.
The fix for IE , with reference to PPKs Quirksmode version:
for (var i = 0; h2 = h2s[i]; ++i) {
if (h2) {
var headerId = h2.id || 'toc-' + i;
h2.id = headerId;
var li = document.createElement('li');
var link = document.createElement('a');
link.setAttribute('href', '#' + headerId);
var span = document.createElement('span');
span.appendChild(document.createTextNode(h2.firstChild.nodeValue));
link.appendChild(span);
li.appendChild(link);
ol.appendChild(li);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| toc_block.tar.gz | 1.74 KB | dman |
Comments
Comment #1
nedjojstools is no longer maintained.