PDA

View Full Version : top level sections js Scripts


pinbrook
25-Sep-2003, 09:54 PM
Has anyone edited the javascript which displays top level section links and subsection links so that only the subsections are clickable?

if so can I have the code please?

Thanks in advance

Menar
30-Sep-2003, 03:10 PM
Hi there,

Try out the following code, which shall disable all your top level section therefore only the subsections will appear as link(s) or be clickable:

Creating a List of Hyperlinks with Sections and Two Levels of Sub-sections
This code will lay out your sections and two levels of sub-sections within a list of hyperlinks. The sub-sections will appear indented.
Paste the following code within the <HEAD></HEAD> tags of your Overall Layout template:

<!--@act NETQUOTEVAR:SECTIONTREE_RAW -->

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function SectionList(ar)
{
var strIDs = '<table border=0 width=95% cols=2>';
for (var i=1;i<=ar.length;i++)
{
if (ar[i].sURL !=null)
{
strIDs += '<table><tr><td colspan=2><span class="actxxsmall">' + ar[i].sName + </span></td></tr></table>';
{
if (ar[i].pChild)
{
for (var j=1;j<=ar[i].pChild.length;j++)
{
strIDs += '<table><tr><td><img src=shim.gif width=5></td><td><a href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].sName + '</span></a></td></tr></table>';

{
if (ar[i].pChild[j].pChild)
{
for (var k=1;k<=ar[i].pChild[j].pChild.length;k++)
{

strIDs += '<table><tr><td width="20"></td><td><a href="' + ar[i].pChild[j].pChild[k].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].pChild[k].sName + '</span></a></td></tr></table>';

}
}
}
}
}
}
}
}
strIDs += '</table>'
return strIDs
}
//-->
</SCRIPT>

and this bit to go into the main body:

<script language=Javascript1.1>document.write(SectionList(section_tree))
</script>