|
PageSync Overview
A number of Cool Focus Flash menus are able to keep the last-selected menu item highlighted until the next is clicked. This provides a visual tie between the menu and the page displayed in the site's main frame. As long as the visitor always uses the menu to navigate, he's always got that visual reference.But what if he uses the browser's Back or Forward buttons? Or if you include hypertext links to your other pages and he clicks one of those? Without PageSync, the menu's selected item won't change and the visual tie between page and menu is gone. PageSync is a system built into iTab and many other Cool Focus menus which allows the pages on your site to inform the menu of which tab to select. Each page you link to from the menu includes a simple line of JavaScript: when the page is opened - by any method - this script contacts the menu and tells it what to select. Although iTab supports the PageSync feature, you don't have to include the script in every page the menu links to, or indeed in any pages at all. If there are pages that don't contact the menu when they open, the menu will just leave the current tab selected. Both of the iTab examples in this documentation show PageSync in action. View the source of the example pages and the pages loaded into the <iframe> to see the script used.
PageSync Limitations
Using PageSync
PageSync should only be used in framed sites, where iTab is placed in a permanent frame or is loading pages into an HTML <iframe> on the same page. If you don't use frames, or you reload iTab in every page, PageSync will not work correctly - you should use the SelectedTab parameter instead.
Reading The Current Selection
Another JavaScript function can be used to read the index number of the current tab, if required. To use this function, paste the following code into the page containing the earlier script
block:
This function return the 1-based index of the currently-selected tab. If an error occurs, the function returns 0. This function can be used within script in a web page like this:
|