PDA

View Full Version : Drop Down Menu Issue



java_dude
04-15-2005, 02:22 PM
Hi, I've been trying to use the Anylink Drop Down Menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm) to make a layered dropdown and it seemed to work great when I used it on a blank page to test it out. IT worked fine in both IE and Firefox.

Then I added it to the page that I want to use it on (with content) and for some reason it didn't work the same in Firefox, but it still worked great in IE. In FF, the first time the page loads it works like normal, but if you refresh the page it won't show the menu when I hover over the button. And when I check the JS console it gives the error

"document has no properties"

and when I click on that error, it hilights the code



var ie4=document.all
var ns6=document.getElementById&&!document.all


From within the script. I've tried everything and I can't firgure it out. I just copy and pasted the code exactly and didn't change anything, and I still get the same thing. Can some one help? Thanks in advance!

jscheuer1
04-15-2005, 02:34 PM
I cannot duplicate this behavior using FF1.0.2 in windows XP on the demo. Are you using a Mac? If not, could you please post a link to the problem page?

java_dude
04-15-2005, 11:44 PM
Sorry for the late reply, the file was on my home computer and I didn't upload it until just now. :) Here's the link: http://salmoneus.net/test/ff-problem.html.

The menu that's causing the problems is at the top of the page, right above the iframe and I've tried everything that I can think of to fix it. Any help would be great!

jscheuer1
04-16-2005, 03:45 AM
I didn't get the error you describe and the menu behaves the same in IE6 and FF1.0.2. It drops down but, clicking on it does nothing in either browser. I do get an error in FF depending upon how far down the list I hover my pointer:

Error: b has no properties
Source File: file:///C:/webwork/side/agility/agility.htm
Line: 131

That could be eliminated at least one of two ways. But, it doesn't seem to effect the performance of the menu which, as I said, is limited in either browser. Refreshing the page makes no difference. Here is the code that could be changed:
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}just doing a check for b will fix or at least eliminate the error:


function contains_ns6(a, b) {
if (b){
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
}

I'm not giving up on this yet but, I don't see what the menu is supposed to do. I mean, I can guess there are other 'calculators' to come but, without anything for the menu to do, it is hard to see if it is doing anything. If it acts differently for you, let me know.

java_dude
04-16-2005, 04:54 AM
It's fixed! :P It's amazing that you pointed that out, I thought it had something to do with the error I was getting before. But if that didn't have anything to do with the problem I was getting... well there was a browser update an hour ago for Firefox, could that have fixed it?

The reason the menu didn't have any links was because I had just put a quick image I made before to test it out with, but you're right that there are going to be more calculators. :) The links are going to open up in the iframe and I thought that a drop down menu would add a cool effect. Thanks again for your help!