Home All Groups Group Topic Archive Search About
Author
7 Mar 2006 11:04 AM
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[i])
        objMenu.style.height = objMenu.clientHeight +
(menuHeightCollection[i]/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[i])
     objMenu.style.height = menuHeightCollection[i];
   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[i])
        if (objMenu.clientHeight > menuHeightCollection[i]/10)
     objMenu.style.height = objMenu.clientHeight -
(menuHeightCollection[i]/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

Author
7 Mar 2006 11:55 AM
Armin Zingler
Show quote Hide quote
"ruca" <rui.vie***@eloinformatica.pt> schrieb
> 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 */
>
> [...]
>
> --
> Programming ASP.NET with VB.NET


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


Armin
Author
7 Mar 2006 12:07 PM
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.
Author
16 Mar 2006 11:41 PM
Pandurang Nayak
Holds good for all other array indexers as well.

Show quoteHide quote
"Jordi Rico" wrote:

> 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.
>
>