Fix for submenu display position?

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Fix for submenu display position?

Post by Ruth »

This might be a little involved since I don't have a site yet to show what I am trying to do. I made a little menu gif, and set it as a draggable. When you mouse over it opens a 'submenu' which is actually the main category menu. I set the submenu offsets so that when you mouseover the little menu gif the 'main category menu opens just below it so it looks like a sliding type menu. The problem is, now ALL the submenus use those same offsets and I need them to have different ones, is there a way to do that?

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

Post by Ruth »

:D :D I got my own answer so thought I'd post it. Just put in another menu array, without the line about leaving intact only once, for the other submenus.

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

Post by Ruth »

Thought I'd better post that that doesn't work :( and nothing I've tried works :cry: ......
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Got a URL we can see?

Kevin
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Sorry Ruth... :oops: I went and asked for a URL when your first post clearly said tat you didn't have a site yet.

If I understand you correctly, you want to specify offsets for each submenu individually, rather than use the global offsets that are typically found at the top of the array file (suboffset_top and suboffset_left).

I'm assuming that your dragable menu gif is also a Milonic menu set to be Always Visible and made dragable, like the sample dragable menu on the Milonic site. If that's the case, then the offset problem should be relatively easy. A little known function of the Top and Left elements of a menu array (2nd and 3rd elements repectively) is that they can be used to specify offsets for each menu. Usually, when Top and Left are used, they are set to numeric values to set an absolute position. In most implementations, these two elements are not set in submenus, so that the system will automatically determine the opening position based on the calling menu item's position. However, you can specify an offset string in the Top and Left elements, like so.

"offset=5"

It must be a string, so the quotes are important; you could use a string variable as well. The value (5 in the example above) indicates the number of pixels to offset the menu from where it would normally open if the Top or Left element was left blank. You can use positve or negative values.

Hope that made sense (it's late here) and that it helps.

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

thanks, that works, another ?

Post by Ruth »

This time I put up a test page so it could be seen, though some images are not up there. Anyway, I fixed it so the first submenu that comes off of a 'backimage' has to be clicked to open, then all the other menus off that one will open on mouseover. But, how do I fix it so that that first submenu you open on click stays open until you click it closed and not just until you stop doing mouseover on the other links? Is that possible? It's like once it's opened I want it to stay opened unless you actually click that particular menu closed. Thanks.... :?

LINK REMOVED

Ruth
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Using the functionality of the menu alone, I doubt it is possible. But heres how you'd do it will alittle javascript trickery....hopefully you are tech savvy enough to follow what I am saying.

Basically put your menu inside of a table consisting of one column, two rows. The top row will say MENU in it, and the second row will have its style attribute called display set to NONE. This will give you what looks like your menu when you first visit the page. Place your menu code inside of this second table cell thats initially hidden. Then put an ONCLICK event handler on the MENU row that says when clicked, change the display style of the menu's cell to block if its hidden, or hidden if its visible.

Code: Select all

<table>
<tr><td onClick='toggleMenuCell();'>MENU</td></tr>
<tr>
   <td id='tdMenu' style='display:none;'> 
            <!-- PUT YOUR MENU HERE -->  
   </td>
</tr>
</table>
Now have javascript code that says:

Code: Select all

function toggleMenuCell()
{
   menuCell = document.all["tdMenu"];
   if( menuCell.style.display == "none" )
   {
      menuCell.style.display = "block";
   }else{
      menuCell.style.display = "none";
   }
}
This SHOULD help solve your problem. Let me know if it works!
P.S. The javascript function above will only work with Internet Explorer, due to my use of the 'document.all[]' call I made. TO make this browser independant, you'll have to do alittle additional code. You should be able to find info on that on the net without me having to explain it here.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks, Dave. I will mess with it, and no I'm not tech savvy. My method is to 'play' I guess the term would be. However, if the menu will take an onclick event to open it, isn't there a way to put in an onclick to close it also? Again, I really don't understand much how code works, I can copy and paste etc. but...for example, in this instance to get the 1st submenu to open onclick I initiated the code in the main menu which has 'plainstyle' as properties, but the 1st submenu that opens has a different property array, and I noticed at the end of the menus properties it has a place that says 'miscellaneous menu properties, could a javascript code or something be put in there which would be for an onClick close menu? And if yes, I'd need some help with how to do the coding, since I don't know how to write codes. Sorry, if the question seems rambling, but without knowing about the coding it's hard to figure out how to phrase the question so the more knowledgeable know what is being asked.

Ruth
Post Reply