why the weird menu offset when placed in table!!

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

why the weird menu offset when placed in table!!

Post by nwilcox »

[address removed]

I have no offsets for the top menu yet it is offset vertically by 16pixels?

Here is my code:

//menu declaration

with(milonic=new menuname("TopMenu")){
alwaysvisible=1;
orientation="horizontal";
style=menuStyleTop;
aI("itemwidth=100px;itemheight=29px;text=contact us;status=contact us;url=/contact/contact.cfm;");
aI("itemwidth=155px;itemheight=29px;text=create new account;status=create new account;url=/member/create_account.cfm;");
aI("itemwidth=70px;itemheight=29px;text=home;status=home;url=http://www.asa-advantage.org;");
}

//style declaration

with(menuStyleTop=new mm_style()){
bordercolor="#948E63";
borderstyle="solid";
borderwidth="2px";
fontfamily="Times, serif";
fontsize="16px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#948E63";
offcolor="#FFFFFF";
onbgcolor="#C6C19B";
oncolor="#FFFFFF";
outfilter="";
overfilter="";
padding=0;
pagebgcolor="#638663";
pagecolor="#FFFFFF";
separatorcolor="#C6C19B";
separatorsize=1;
separatorheight="15px";
separatorpadding="1px";
subimage="";
subimagepadding=0;
rawcss="text-align:center;"
screenposition="top=-16px;"
}


okay pretty straght forward right? I'm at a total loss for words here...
Last edited by nwilcox on Tue Dec 19, 2006 8:52 pm, edited 1 time in total.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You don't have position='relative'; in the main menu that's in the table. Also, this code screenposition="top=-16px;" is not a style property, it is coded in the actual menu, though it seems you are using it to try and move the menu back into position and the position='relative' will do that so you don't need the offset.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

EDIT

wow.. now when I click on the middle button I get this weird shifting in IE 7.. like it animates and removes left padding from my buttons

yikes... that is something new!

duh! I'm retarded

thanks Ruth.. that did it!

while I've got you... I can't get the pagematch to work with page anchors?

I've got a menu with 6 items each going to the same physical page with different anchors. None of them are highlighting?

I tried using pagematch and it didn't do anything :(
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Sorry, i need the url back so I can get the anchor page where those are and experiment.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

http://www.asa-advantage.org/resources/ ... ?devtype=1

sorry... both issues are very perplexing

thanks for your help!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Never mind, I got it from downloading the page :)

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

The page match isn't going to work with just the anchor, you need to have the full path in each. i.e.

Code: Select all

aI("text=Objectives;status=Objectives;url=/info/info.cfm#objectives;pagematch=/info/info.cfm#objectives;");
That should work. Of course my test was using info.htm since I don't have cf but it worked.

I can't help with IE7, you might have to post a separate topic. Check the css padding code and table, td, tr code and margin codes, they sometimes affect the menu.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

okay I just tried the full path with the pagematch and it still doesn't work...

any other suggestions? Is it an issue because all the links are to the same page?

The other weird IE7 issue was fixed when I put a fixed width on the overall menu...
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, I don't know on the pagematch since when I tried it was working. You might try the 'full' path to the info.cfm page, the http etc., when I tried it on my desktop all the files were in the same folder so I just had info.htm#objectives as the match.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

okay I tried the full path including the HTTP for both the URL and the pagematch parameters.

Now regardless of the page I go to in that menu, my second menu item is staying highlighted

yikes ... now I'm even more confused
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

That's because the intellectual page is development.cfm?devtype=1 and that is the page of the link you provided so there is a match and that makes the Personal Development item highlight as well as the Intellectual child item.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

http://www.asa-advantage.org/info/info.cfm#objectives

I'm sorry Ruth I gave you the wrong address

If you look at the Program Information menu that is what I'm having problems with

Thanks! ;)

PS... I just tried it again and it appears to work the first link you click on in that menu

Then the rest of the links I click, the pagematch stays on the first link I clicked. This is the Program Information menu
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

It seems that once one of those items is clicked when you click another the menu thinks it already has initiated the pagematch. I don't know if that's something the menu can do, match a number of anchors on a page. I'll ask Milonic. It just may not be possible. I did find something you can do to show that the link is clicked, but it will be that color as long as you're on the page even when you click another one of the anchors so they all end up being colored. You could use different colors? Anyway, while I try to find out if pagematch can be done on anchors on the same page in place of pagematch you could use clickbgcolor= and clickcolor= in each of those items. You might want to do different colors as to bgcolor that way they'd look different after they were clicked.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

awesome thanks Ruth

I really appreciate your assistance today!

This is the first time I've come across the anchor issue but it seems to be something that could happen with other customers...

:)
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

Hi Ruth,

Any updates from Milonic on my quest to figure out the page anchor issue?

Thanks!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

No, no updates. I did post it and I'm sure they'll do what they can if it's possible. It may require too many parameters or variables to try and get multiple anchors on the same page to work with pagematch. If you check the Menu Version info when a new version comes out it will tell you what has been fixed, if it's a fix and anything new that gets put in. That page also has pre-releases available to test them as they are in development.

http://milonic.com/menuvinfo.php

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

thanks Ruth... much appreciated

I think I may know why it isn't working. When you go to a page anchor iwthin a page, the page is never refreshed so the menu doesn't have a chance to catch up with the browser.

I don't think what I want to do is possible unless I refresh the page after I hit the link?

yup I just tried it and that appears to be the case. It is the lack of page refresh when linking to page anchors within the same page!

ack!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Thanks for the info, that's helpful for anyone else who asks about it. It looks like the clickbgcolor or clickcolor or both are your best options. At least if you used clickcolor it would be a kind of 'visited' link. You can't use visitedcolor because once you click one all the other anchors with visitedcolor property set also turn, before you've clicked them. So, at this point it looks like just the click options will work.

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

well are each menu item links referencable via the JavaScript DOM?

I coudl write a function that turns the current click color and click bgcolor and turns hte other ones off. However I'd need a way to access the individual menu links programmatically.

Thanks!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You can do that, but you are way over my head. I know there are methods and functions. I know you can 'find' items using these, but I don't really know what any of that is. My knowledge of js is limited to knowing you spell it javascript.... :lol:

You might try the methods and functions page that might give you some ideas. Sorry :(

http://milonic.com/menu_methods.php

Ruth
Post Reply