Error with converted menus

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

The error is still there. Sorry...
John
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

I just noticed you do not define top anywhere in your code. I was going through the menudom code and saw some correlation between top and _tp, and although I really am not sure exactly what their relationship is, I think they have something to do with eachother. In your topMenu, set your top=0; and in your bottom menu set your top to top="offset=0";

Let me know if that helps.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

Hergio wrote:I just noticed you do not define top anywhere in your code. I was going through the menudom code and saw some correlation between top and _tp, and although I really am not sure exactly what their relationship is, I think they have something to do with eachother. In your topMenu, set your top=0; and in your bottom menu set your top to top="offset=0";

Let me know if that helps.
Right, I've done that - e.g. from menu_data.js :

Code: Select all

with(milonic=new menuname("TopMenu")){
top=0;
left=10;
But I am still getting a totally unpredictable and erratic error, only this time it reads:

Line: 17
Char: 324
Error: Invalid argument
Code: 0

This error message is stopped by removing the line top="offset=0"; from menu_data.php. If I change the top="offset=0"; line to two lines top=0; offset=0; then I get back to the old unpredictable and erratic _tp error.......
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Ok, lets do some more troubleshooting if you dont mind here. Try each one, see if it works, then move on to the next...

Firstly, remove the offset=0 line, there is no offset property. It must be passed in as part of the top or left property.

Secondly, remove the alignment="right" and alignment="center"...there is no property by that name. There is however an "align" property that can be declared in either a style, menu, or menu item.

Comment out your screenposition properties in both menus. Make sure to give both menus definite top and left coordinates. Say your top menu should have top=10; and left = 5; and your bottom menu should have top=300; and left = 5;. See if this remedies the error. Its gotta have something to do with your positioning I think...the _tp is making me think that way.

Try commenting things out after that and try different combinations of things to see if you do one thing and it fixes it, note what happens and let us know.

We'll figure this out soon enough!
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

I worked my way through your list of suggestions, Dave, until I got to changing top=0; to top=300; in menu_data.php (without having got so far as to comment out the screenposition properties). I think (!) that the error may have gone away, but due to its erratic and unpredictable nature it may still be there. Please would anyone let me know if they still see it on my website at http://www.the-limes.com ? If the error has gone, then it would appear that with a screenposition="bottom"; property it is necessary to have a top=#; property with a value greater than 0.

While we are sorting these things out, can you please tell me how to nudge up a few pixels from the bottom of the screen the display produced by menu_data.php?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Much as it pains me to say this - :roll: - I don't get the error now. Of course, as you say, it could still be lurking somewhere...
John
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Pains you? I am excited! :D Ok we are getting somewhere! Now it kinda makes sense though, if in a menu you do not declare a position, what does it default to? absolute, right? So for anything to be absolute it needs coordinates and he wasn't giving them to the menu. Even if you have screenposition set, it needs something apparently. Even if the menu is top and left, you should at least put in 0,0, ya know? And if its on the bottom, set it to something, and the screenposition should take over from there. I think its not lurking anymore, I think it was the top/left properties needing to be set.

Regarding moving the menu up, try for your bottom menu top="offset=20"; or top="offset=-20";
I am unsure which direction it will go and also if the -20 will work because someone recently mentioned they can't get negative offsets to work. But thats how you would tweak the screenpositioning...as seen with example 23 on the milonic website, "using screenposition and offsets".... Best of luck!
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Hergio wrote:Pains you? I am excited!
Of course! It means we are coming to the end of this marathon :!: :D
John
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

Yes, I think my friends, that we can say that this one is now sorted. Many thanks to everyone who helped or tried to help!
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

Hergio wrote:Regarding moving the menu up, try for your bottom menu top="offset=20"; or top="offset=-20";
I am unsure which direction it will go and also if the -20 will work because someone recently mentioned they can't get negative offsets to work. But thats how you would tweak the screenpositioning...as seen with example 23 on the milonic website, "using screenposition and offsets".... Best of luck!
It's no good using the top="offset=20"; or top="offset=-20"; method because the 'screenposition' property overrides the 'top' property, and besides which it gives the error:

Line: 17
Char: 324
Error: Invalid argument
Code: 0

On the example 23 menu generator on the website, as the other user noted, negative offsets don't work because numeric integer values are only permitted and as a consequence the minus sign is not recognised.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Actually after looking at Andy's code for sample 23, he is accepting negative integers, just doing nothing if they are found. He just takes the value straight from the offset box and puts it in a conditional statement as in if( toffset >= 0 ) { ...change the offset } and same for left. Yes, this IS an implicit cast to an integer, so abc would not work since abc >= 0 would not resolve to true. But -45 would be accepted but fails the conditional and so nothing is done.

On the other note, offsets are only supposed to be used with screenposition is what I gather from what Andy has said in the past. See...
viewtopic. ... ion+offset
viewtopic. ... ion+offset
viewtopic. ... ion+offset

Not sure what the problem is.... hmmm :roll:
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
simongdawson
Super Advanced
Super Advanced
Posts: 49
Joined: Sun Oct 12, 2003 6:56 am
Location: UK
Contact:

Post by simongdawson »

I have played around with the 'top' property until I am blue in the face, but I still cannot prevent the erratic and unpredictable error

Line: 17
Char: 324
Error: Invalid argument
Code: 0

from appearing from time to time. I have currently left the menu_data.php file on my website including the following code

Code: Select all

with(milonic=new menuname("BottomMenu")){
top="offset=-7";
left=10;
itemwidth=150;
style=menuStyle2;
screenposition="bottom";
alwaysvisible=1;
followscroll=1;
so the error will be showing from time to time on the pages of my website at http://www.the-limes.com.

Anyone got any ideas?
Post Reply