473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Browsers

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).chi ldNodes(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
Mar 7 '06 #1
3 1228
"ruca" <ru********@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
Mar 7 '06 #2
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.

Mar 7 '06 #3
Holds good for all other array indexers as well.

--
blog: www.thinkingMS.com/pandurang
"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.

Mar 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Terry A. Haimann | last post by:
I have been working on creating a dynamic web page and have made slow but steady progress. What I have now has an opening page with two drop down boxes. Based on a choice from the first box, the...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
12
by: confused | last post by:
After expressing my interest in expanding my new knowledge of HTML and CSS into the wild realm of JavaScript, I was advised that it is wiser to avoid it, since not all browsers are use it or are...
12
by: code_wrong | last post by:
Hi, as the subject says How many browsers must we support? How many are there exactly? When I run this JavaScript in Firefox and IE6: function init(){ if(document.getElementById) alert("W3C...
6
by: Richie | last post by:
I went through the past six months or so of entries in c.l.javascript, and found a couple where people had expressed opinions about the value of supporting much older versions of Netscape and IE. ...
14
by: Xah Lee | last post by:
is there somewhere i can find the default css for browsers? e.g. what's the usual rendering in terms of css for <p>, <ul> etc. in particular, right now i'm interested in creating a style...
24
by: abracad_1999 | last post by:
I'm told the standards way of referencing page content is document.getElementById() What is the lowest version of each browser type with which this will work? Thank you
4
by: Bart Schelkens | last post by:
Hi, It might be a stupid question. I'm creating a webapplication using vb.net. I was wondering can this webapplication be viewed in other browsers besides Internet Explorer? Or are we limited...
133
by: Alan Silver | last post by:
Hello, Just wondered what range of browsers, versions and OSs people are using to test pages. Also, since I don't have access to a Mac, will I have problems not being able to test on any Mac...
77
by: VK | last post by:
Randy Webb wrote: > VK said the following on 5/2/2006 9:48 AM: > > If you mean "trying to render it" then FF behavior is the same as for > > all other UA's willing to be in use (and not W3C...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.