I have only ever been able to do it with PHP, never with Javascript.
And in the PHP code, I essentially write an IF statement that checks the "section" a certain page is (in an external array page), and if the section is true, then the PHP writes id="current" to the link.
This is what my PHP code looks like:
Code:
<li><a <?php if ($pageID["section"]=="home") {echo "id=\"current\" ";} ?>href="index.php">Home</a></li>
However, it can't be that difficult to redo in Javascript. I would think that if you made an id on every body tag, and then wrote a function that read against which id was which, that would do it.
But I don't actually know enough about Javascript to write it out myself.
Bookmarks