PDA

View Full Version : AnyLink Drop Down Menu bug in IE?



alex77
10-04-2005, 12:19 AM
Script: AnyLink Drop Down Menu
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

--------------------

I am having problem with the script when I have a form drop down list right below the top level menu where the drop down menu would normally "drop down." The html form drop down menu would stack up in front of the AnyLink drop down menu items that is in that position. I only have this problem in IE but not in Firefox (haven't tested it in Opera yet).

To better illustrate the problem, I have created a simple website that recreates the problem below:

http://markets.acmeanalytics.com/~alextan/

I couldn't figure out how to correct this problem, so any help would be appreciated. Thanks in advance!

jscheuer1
10-04-2005, 04:28 PM
Don't put the select so close to the menu. Or hide it when the menu drops down - put this:

if (ie4){
selects=['sel1', 'sel2']
sels=ie4.tags('select')
for (var i_tem = 0; i_tem < sels.length; i_tem++){
for (var j_tem = 0; j_tem < selects.length; j_tem++)
if (sels[i_tem].id==selects[j_tem])
sels[i_tem].style.visibility='hidden'
}
}right after this:

function dropdownmenu(obj, e, menucontents, menuwidth){and this:

if (ie4){
for (var i_tem = 0; i_tem < sels.length; i_tem++){
for (var j_tem = 0; j_tem < selects.length; j_tem++)
if (sels[i_tem].id==selects[j_tem])
sels[i_tem].style.visibility='visible'
}
}right after this:

function hidemenu(e){This line is where you configure the ids to use (they can be the existing selects id's if they have them):

selects=['sel1', 'sel2']

If they don't have them, give your select(s) ids:

<select id="sel1" name="select">If you only have one select, you still need two ids configured in:

selects=['sel1', 'sel2']

for it to work, the second one can be a dummy. You can add as many id's as you need:

selects=['sel1', 'sel2', 'sel3', 'sel4']

alex77
10-04-2005, 10:30 PM
Hi John,

The codes you gave me to work around the problem was very helpful. I really appreciate you taking the time to lay it out for me.

Again, thanks a lot!

Alex