B
Brenton
Hi
I'm new to the group so if I make a major blunder posting this here I
apologise in advance.
I'm not a Programmer by any stretch of the imagination and I've been
trying to sort out a small JavaScript that I found here:
http://www.interspire.com/content/a...-Expanding-DHTML-Menu-With-CSS-and-JavaScript
if I use what is supplied it works fine, but a little further down
there is a enhancement that I just can't get to work. It seems to be
because of the { and }.
This is the script that needs to be fixed:
menu_status = new Array();
function showHide(theidPrefix, theidNum)
{
// show / hide clicked menu element
if (document.getElementById)
{
var switch_id = document.getElementById(theidPrefixtheidNum);
if(menu_statustheidPrefixtheidNum != 'show')
{
switch_id.className = 'show';
menu_statustheidPrefixtheidNum = 'show';
}
else
{
switch_id.className = 'hide';
menu_statustheidPrefixtheidNum = 'hide';
// hide non - clicked menu elements
n = 1;
while( document.getElementById(theidPrefixn) )
if(n !== theidNum)
var hide_id = document.getElementById(theidPrefixn);
hide_id.className = 'hide';
menu_statustheidPrefixn = 'hide';
n;
}
}
}
If anybody here could give me a pointer I would greatly appreciate it.
Regards
Brenton
I'm new to the group so if I make a major blunder posting this here I
apologise in advance.
I'm not a Programmer by any stretch of the imagination and I've been
trying to sort out a small JavaScript that I found here:
http://www.interspire.com/content/a...-Expanding-DHTML-Menu-With-CSS-and-JavaScript
if I use what is supplied it works fine, but a little further down
there is a enhancement that I just can't get to work. It seems to be
because of the { and }.
This is the script that needs to be fixed:
menu_status = new Array();
function showHide(theidPrefix, theidNum)
{
// show / hide clicked menu element
if (document.getElementById)
{
var switch_id = document.getElementById(theidPrefixtheidNum);
if(menu_statustheidPrefixtheidNum != 'show')
{
switch_id.className = 'show';
menu_statustheidPrefixtheidNum = 'show';
}
else
{
switch_id.className = 'hide';
menu_statustheidPrefixtheidNum = 'hide';
// hide non - clicked menu elements
n = 1;
while( document.getElementById(theidPrefixn) )
if(n !== theidNum)
var hide_id = document.getElementById(theidPrefixn);
hide_id.className = 'hide';
menu_statustheidPrefixn = 'hide';
n;
}
}
}
If anybody here could give me a pointer I would greatly appreciate it.
Regards
Brenton