Clicking on entries in the outline is not the only way a user can navigate your site. You may well have links on your pages that offer users alternative ways of navigating your site.
When a user uses such a link, you may want the outline to update to let the user know where he/she now is in the overall structure of the site. To do this, you need to add some code to the top of each of your pages. The first thing to do is identify the outline entry that corresponds to the current page. This can be done using the findEntry method. The findEntry method offers several ways of searching for an entry. The most common method is to find an entry with a URL that matches the URL of the current page:
entryID = parent.theMenu.findEntry(location.pathname, "url", "right", 0);
Having identified the entry that corresponds to the current page you will want to make sure it is visible. The setEntry and refresh methods will do this:
if (parent.theMenu.setEntry(entryID, true)) { parent.theMenu.refresh(); }
Note that setEntry returns true if the outline needs refreshing, so the above code only refreshes the outline if needed.
Finally, if you have added "selected" images, you will need to use the selectEntry method to select the entry:
parent.theMenu.selectEntry(entryID);
Putting this all together gives you the following:
if (parent.theMenu) { var entryID = parent.theMenu.findEntry(location.pathname, "url", "right", 0); if (entryID >= 0) { parent.theMenu.selectEntry(entryID); if (parent.theMenu.setEntry(entryID, true)) { parent.theMenu.refresh(); } } }