|
PageSync
SuperTree provides an ExpandedFolder parameter which you can use to specify which folder (if any) is expanded when SuperTree starts. However, if you have a non-framed site and reload SuperTree in every page, you may wish to expand different folders in different pages. The instructions and script below explain how to do that.1. Make sure the ExpandedFolder parameter is not included in your datafile. (Setting this parameter is likely to interfere with the behavior of the script.) 2. Copy the script below into every page containing SuperTree. The script can be placed anywhere in the head or body of the page.
<script language="JavaScript">
<!-- var timeid=0; var loaded=false; function expand(s) { if (!document.SuperTree) {timeid=setInterval("expand('" +s + "')", 500); return;} clearInterval(timeid); try {loaded = document.SuperTree.GetVariable("loaded") == "true";} catch(e) {timeid=setInterval("expand('" +s + "')", 500); return;} if (!loaded) {timeid = setInterval("expand('" + s + "')", 500);} else {clearInterval(timeid); document.SuperTree.SetVariable("expfolder", s);} } // --> </script>
4. Add the following ONLOAD attribute to the <body> tag of the page.
onload="expand('Our Products')"
Change the text Our Products to the exact (case sensitive) text of the folder item you want to expand. (This folder can be anywhere in the tree, at any level. SuperTree will find and expand its parent folders automatically.) Be careful not to remove the single-quotes around the text.
|