Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:20

HELP: Popup Menu goes off edge of page


Poster: LotteryPost
Dated: Sunday July 11 2004 - 18:13:31 BST

I am in the process of converting my site to use Milonic popup menus extensively, but just hit a pretty major bug.

I have popup menus that activate when the user clicks a link. The popup is positioned to the link by referencing the link ID in the popup function. For example, Popup('menuname', 'linkID')

When the link is close to the right border of the page, instead of bumping the popup to the left to fit it on the page, the menu is popped up over the right border of the page, and the page is dynamically expanded to be wider. (It generate a scroll bar at the bottom of the page.)

The strange thing is that the menu funcitons correctly if the popup is too close to the bottom of the page - it move the menu up until it fits.

You can check out the test page here:

http://www.lotterypost.com/milonic/

Try clicking the User Names on the right side of the page. (The links next to the Green Arrows.)

Obviously, I can't go into production with this kind of bug!

Your help is greatly appreciated.

-Todd


Poster: Ruth
Dated: Monday July 12 2004 - 13:54:48 BST

Hi Todd
I'm not an advanced person with the menu code, but in simple terms what's happening is that the pop menu is opening with the left side aligned with left side of the table cell in which you have that link id. I believe that's kind of in the menu programming, i.e. in a horizontal menu the submenus would open with the left side of the sub lined up with the left side of it's parent item. There is a topic that has to do with finding the x-coordinate HERE, which I believe is an attempt to be able to use some javascript to place the submenus. There is also the methods and functionsreferences which discuss menu position, getting the position and setting the position, but you will need to know some javascript to use this, and you could probably, if you knew javascript, write a function that would align the right side of the menu with the right side of that table since that is a fixed width pop up of 200px, though I can't swear to that since I don't know javascript nor the internals of the menu program
I downloaded your page to play with it and see what non javascript function options I could figure out. The only two I saw were -- to reverse that table layout so that the column with the 'Last post by' and the names of the posters is the left column of the table and the Topic is the right. The other option would be to put the id= in that left column, however I don't think you can do that since the topic is not a 'fixed' item like the name of a person.
Hope some of this helps. If nothing seems useful, please post back and maybe we can get some more input.

Ruth


Poster: LotteryPost
Dated: Monday July 12 2004 - 14:07:54 BST

Ruth,

Thanks for the reply.

I am not aligning the popup with a table cell - I am aligning it with the link itself.

I plan on using the popups extensively throughout the Web site, so it need to be done in a generic manner. I can't hardcode the menus to right-align one place and left-align another place.

According to the documentation that I've seen online, the menus are supposed to recognize that they will run off the side of the page, and automatically adjust their x-coordinate to make sure this doesn't happen. That happens correctly on the y-coordinate, but it is not funcitoning correctly for the x-coordinate.

Do any of the Milonic developers monitor this forum? If not, is there someone else I should be contacting about this?

Thanks!

-Todd


Poster: Ruth
Dated: Monday July 12 2004 - 14:47:40 BST

Yes, they do check the forum when time permits, you might contact support with the issue. It seems to work by resizing the submenu to be less wide in a regular drop down, but not in the pop ups.

Ruth


Poster: Andy
Dated: Monday July 12 2004 - 18:01:36 BST

Hi,

Version 5.33 has just been posted that should hopefully fix the problem you are seeing.

Cheers
Andy


Poster: LotteryPost
Dated: Monday July 12 2004 - 18:15:12 BST

Awesome, I'll check it out and report back.

Thanks!


Poster: LotteryPost
Dated: Monday July 12 2004 - 18:30:59 BST

I uploaded the new code, and it was 95% successful.

I'm going to be picky here, but from the attention to detail you have put into your menus, I'm guessing that you try to get things 100% perfect.

When I click open the User Name popup menus (the ones that ran off the side of the page), in IE it still runs off the page by 3 pixels. (And creates a scroll bar at the bottom of the browser page.) I'm guessing that's because of the drop shadow effect not being accounted for, because in a Firefox browser (no drop-shadow) it does not create a scroll bar at the bottom.

Also, the menus are still not opening in several browsers.

- Netscape 7.0 (PC) does not open any popups (the Forums mouseover or the User Name popups)

- Safari (Macintosh) does not open any popups (the Forums mouseover or the User Name popups)

- Firefox (Macintosh) does not open the Forums mouseover, but does open the User Name popups.

Thanks for being so responsive today. These popups are critical for my site, so this is much appreciated!


Poster: Andy
Dated: Monday July 12 2004 - 18:44:23 BST

I think it is the dropshadow - What you could do is specify an offset and shift the menu over by 3 pixels. You can do this by adding left="offset=-3"; to your menu definitions.

The other problem is due to you using name instead of id. You can declare both if you like so you should have

Code:
<IMG height=28 alt=Forums src="lp_files/menu_forums.gif" width=52 border=0 name=navforums id=navforums>


This will most definately fix Mozilla/Gecko and Safari browsers.

Hope this helps
Andy


Poster: LotteryPost
Dated: Monday July 12 2004 - 19:56:24 BST

Andy,

Well, we're almost there. The problem with the 3 pixels was fixed by the offset parameter, but the problem with browser support is half-fixed.

The addition of the id parameter to the image tag fixed the problem in Netscape and Firefox, but Safari is still no-go. In fact, I tried loading your home page in Safari and no menu displayed there either. So I'm thinking the latest version has something incompatible with Safari.

Any ideas?

By the way, thanks for the quick help today. I definitely feel like I made the right choice by going with your menu system.


Poster: John
Dated: Monday July 12 2004 - 21:18:04 BST

LotteryPost wrote:
By the way, thanks for the quick help today. I definitely feel like I made the right choice by going with your menu system.

Hi Todd -

No question about it - ya done good :!: :D

Also, your kind words are appreciated.

A reply from Andy is a reply from the absolute top-of-the-heap (er - so to speak). There's no better DHTML menu system than Milonic, and nobody more dedicated to getting things right than Andy.

Unfortunately, I can't help you with Safari right now. From home, yes, but here at work I'm stuck on a Pee-C. If one of the other folks doesn't beat me to it I'll take a look tonight.


Poster: John
Dated: Monday July 12 2004 - 21:31:16 BST

Meanwhile - I just posted 5.33 on some sites here, but can't find any of my Mac folks to take a look. You might try http://www.west.asu.edu/admin/ (and anything in there) and/or http://westcgi.west.asu.edu/sai/ to see if it comes up.


Poster: Andy
Dated: Monday July 12 2004 - 21:35:51 BST

Which version of Safari is the problem with?

Just tried 1.2.2 and it all seems to be fine, both menus poped up OK, anyone else got Safari?

Cheers
Andy


Poster: LotteryPost
Dated: Monday July 12 2004 - 21:38:34 BST

Hi John,

Thanks for the reply.

I've finished coding the Lottery Post site with popups on all user links and game links. I really like the way it came out, and I found some nice ways to save download time (minimal code on each page).

The latest version of the code is on the root lottery post site (http://www.lotterypost.com), so no need to check out the test "milonic" site any more.

Any assistance you can provide in getting the Safari version to work would be terrific. Safari is a pretty decent browser, so it would be sad if it didn't work.

Thanks,
Todd


Poster: LotteryPost
Dated: Monday July 12 2004 - 21:41:31 BST

Andy wrote:
Which version of Safari is the problem with?

Just tried 1.2.2 and it all seems to be fine, both menus poped up OK, anyone else got Safari?

Cheers
Andy


I am running 1.2.2 (v125.8 ), and it doesn't work for me.

I am also running Norton Internet Security on that Mac, but I don't see it changing (or adding) any JavaScript code. Also, Firefox and Mozilla both work fine on the same Mac.


Poster: John
Dated: Monday July 12 2004 - 21:41:54 BST

No question, Safari is one of the best around (but it does have a little way to go to hit the top). BTW, I'm definitely a Mac person... :D


Poster: LotteryPost
Dated: Monday July 12 2004 - 21:56:40 BST

Just tried some additional browsers on the Mac. Here's the summary:

Safari 1.2.2 didn't work.
Netscape 7.1 worked fine.
Opera 7.52 didn't work.
Firefox 0.9.1 worked fine.
Mozilla 1.5 worked fine.
IE didn't work (but who cares).

BTW, my Mac is a dual 2GHz G5 w/ 2GB RAM, running 10.3.4.

-Todd


Poster: John
Dated: Tuesday July 13 2004 - 5:43:39 BST

I see 1 menu - Forums, Predictions, Active Topics, Search. From that only Forums drops a sub with no problems.

'Username popup' I can't find.

Why have you split the _data file into 2 - menu_data and menu_forums?

Why is one in the head and the other in the body?

You have...
Code:
aI('text=News;url=topics11.htm;status=Go to the News forum;');

Should be...
Code:
aI("text=News;url=topics11.htm;status=Go to the News forum;");

...etc. Note double quotes (").

In menu_data you have varied combinations of single, double, and no quotes. Again, double for strings (numerics can be with oe without).

Empty items; e.g., subimage='';, can be deleted.

I think overfilter=effect; should be overfilter="effect";.

With all due respect, I'm not going any deeper into that compressed HTML. Sorry.

G5 dual 2GHZ, 1.5GB, Safari 1.2.2 (v125.8) with no Norton. See http://milonic.com/forum/viewtopic.php?t=4460.


Poster: LotteryPost
Dated: Tuesday July 13 2004 - 6:01:11 BST

John,

Thanks very much for looking into this for me. I really appreciate it, but I need to make a couple of corrections:

- Single quotes and double-quotes are interchangeable in JavaScript - nothing wrong with using the single quotes in the aI() funciton.
- Ditto for the single quotes in menu_data.
- The effect statement is correct. effect is a variable that contains the string of characters for the effect, and I'm assigning the contents of that variable to overfilter, not the literal string 'effect'.

The username popup (I think I referenced it in one of the earlier posts in this thread) is the username links that appear alongside the small green arrows down the right side of the page. Clicking the link makes the popup menu appear.

Splitting the menu and data files makes it much easier for me to maintain the menus in the future. I can add/remove/change menus without worrying about where the style info is kept. Kind of like separating a CSS file from where it is used.

Putting one in the head and one in the body made it easier to fit into my code structures. (The site has a LOT of code reuse, so it is put together like a jigsaw puzzle.)

Again, I appreciate your time and effort in looking into this. Since there are now two of you successfully able to see the menus, I must conclude that it is something about my setup, probably Norton.

Thanks,
Todd