Browsers

R

ruca

Hi,

I have a XP collapsible menu that works fine in IE, but in Firefox don't
collapses. I know both browsers interprets different thigs.
I post the code that I have to allow collapse and expand my menu.

Can anyone give me some help in what I have to change to working with
firefox or mozila ????

function ControlMenu()
{
cnt = 1;
objMenu = this.parentNode.childNodes(1); /* memorize the Menulist has been
clicked */

/* Get the arrow that belongs to the clicked menu */
/* starting with <div> then <table> then <tbody> then <tr> then <td> and
the last one is */
/* what we need: <img> */
var objArrow =
this.childNodes(0).childNodes(0).childNodes(0).childNodes(1).childNodes(0);

if (objMenu.style.display == "none")
{
objArrow.src = imageUp.src; /* change to the Down Arrow */
ShowMenu();
}
else
{
objArrow.src = imageDown.src; /* change to the Up Arrow */
HideMenu();
}

//buttonOn();

}

function ShowMenu()
{
var objList = objMenu.childNodes(0); // get the Linkslist of the Menulist
if (cnt < 10)
{
// display the Menulist
objMenu.style.display = "block";
// increase the tranparency of the Menulist
objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity + 10;
// loop through the Menu collection to find the position of the clicked
Menu
// to get the actual height of the menu list and then increase the height
of the Menulist
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection)
objMenu.style.height = objMenu.clientHeight +
(menuHeightCollection/10);

cnt++;
// do this function again after 30 miliseconds until the actual
Menulist's height is returned
setTimeout("ShowMenu()",30)
}
// display the Menulist if the it's actual height is returned
if (cnt >= 10)
{
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection)
objMenu.style.height = menuHeightCollection;
objList.style.display = "block";
}

}

function HideMenu()
{
var objList = objMenu.childNodes(0); // get the Linkslist of the Menulist
if (cnt < 10)
{
objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity - 10;
for (var i = 0; i < objSpanCollection.length; i++)
if (objMenu.parentNode == objSpanCollection)
if (objMenu.clientHeight > menuHeightCollection/10)
objMenu.style.height = objMenu.clientHeight -
(menuHeightCollection/10);
objList.style.display = "none";
cnt++;
setTimeout("HideMenu()",30)
}
if (cnt >= 10)
{
objMenu.style.height = 0;
objMenu.style.display = "none";
}

}


--
Programming ASP.NET with VB.NET

Thank's (if you try to help me)
Hope can help (if I try to help)

ruca
 
A

Armin Zingler

ruca said:
Hi,

I have a XP collapsible menu that works fine in IE, but in Firefox
don't collapses. I know both browsers interprets different thigs.
I post the code that I have to allow collapse and expand my menu.

Can anyone give me some help in what I have to change to working
with firefox or mozila ????

function ControlMenu()
{
cnt = 1;
objMenu = this.parentNode.childNodes(1); /* memorize the Menulist
has been clicked */

[...]


Does not look like VB.Net code. Please post to the relevant groups only.


Armin
 
J

Jordi Rico

I can't try your code now, but there's something I think you should
change.

Where you put things like:

this.parentNode.childNodes(1);

You should put

this.parentNode.childNodes[1];

JavaScripts arrays use [] instead of (), syntax is C-style.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top