PDA

View Full Version : JsDOMenu 1.3 Error



mevaser
12-20-2006, 02:56 AM
1) Script Title: JsDOMenu 1.3

2) Script URL (on DD): democonfig5.js which comes in the zip file here: http://www.dynamicdrive.com/dynamicindex1/jsdomenu/jsdomenu1.3.zip

3) Describe problem: Every time I check in other's people PC (usually runing Explorer 6) there is a javascript error which shows at the botton of the brourser.

I open the page in Frontpage 2003 SP2, in the preview mode and I see the error too, and it does not load. It says line 2 error, and line 25 where line 25 is the onload in the body insert.

In my home brouser I do not see the error though? I have the lastest Explorer.

Please look at my site to let me know what my problem may be: http://www.mevaser.com/

I have spend a few hours trying to figure out why this thing is acting soo irrational! please,

Karl

jscheuer1
12-20-2006, 06:21 AM
Let's start by saying that the copy of IE 6 that I used for this is a hack designed to work on a PC that has IE 7 installed, so - some of my findings may be off.

I think this part is probably for real -

In nav/jsdomenu.js around line 643 you will find this:


iconElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px;
if (ie) {
var left = getPropIntVal(iconElm, "left");
if (ie55 || ie6) {
iconElm.style.left = (left - getPropIntVal(this, "padding-left")) + px;
}

For some reason, the red parts sometimes generate values that are NaN instead of numbers. This problem was reported in IE 6 as:


Line: 643
Char: 3
Error: Invalid argument

NaN is the only thing that doesn't equal itself, so I added:


if(Math.floor((this.offsetHeight - height) / 2)==Math.floor((this.offsetHeight - height) / 2))
iconElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px;
if (ie) {
var left = getPropIntVal(iconElm, "left");
if (ie55 || ie6) {
if(left - getPropIntVal(this, "padding-left")==left - getPropIntVal(this, "padding-left"))
iconElm.style.left = (left - getPropIntVal(this, "padding-left")) + px;
}

This took take care of that problem. There were also problems in using the filters in your script/scroll.js script. I think these problems are likely erroneous but, might not be. These problems, showed up in IE 6 as:


Line: 53
Char: 1
Error: The specified procedure could not be found

If I commented out all references to filters and the operations dependant upon them, the slide show worked but, without the filter transitions. As I say, either of these may or may not be real problems.

jscheuer1
12-20-2006, 06:44 AM
I just doubled checked on an old PC with a real copy of IE 6 installed and I was right, the error in jsdomenu.js is real, the one in scroll.js is not.

But, this turned up another NaN problem in jsdomenu.js -

I'm not sure of the line number but, it is around 700:


else {
height = arrowElm.offsetHeight;
}
if(Math.floor((this.offsetHeight - height) / 2)==Math.floor((this.offsetHeight - height) / 2))
arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px;
this.subMenu = menuObj;

The offending code is in bright red, my fix (the same idea as before) in dark red. These errors may be due to your layout, configuration and/or script conflicts but, as these fixes take care of them, unless functionality suffers, I'd go with them. They could just be bugs in the script though. I couldn't see any difference in functionality.

Just to be clear, both here and in my previous post, DO NOT remove the bright red parts. Just add the dark red ones.

mevaser
12-21-2006, 05:20 AM
Thank you!