Why Does It Go Off the Screen?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Why Does It Go Off the Screen?

Post by darkcircuituk »

I am using the context right click menu as I am sure all of you know (I appologise for all my posts, I just have to know :-O ), and I have noted that if you right click at the edge of the page, the right click menu appears at the point of the right click resulting in the menu disapeering off the page, most annoying if the hyperlink you are right clicking on is at the edge of the page.

I was wondering if there was a way in which when the right click menu is goin to go off the page if it could be placed back onto the page with the bottom of the menu inline with the bottom of the page (like the standard microsoft one acts).

Any help you can provide on this problem will be greatly appreciated as usual.

Dave

Just as an afterthough, is there an award for the best kept support forum because if there was I would definately vote for yours!!! Keep up the good work you groovy cats!!!
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

A url would be good, can you provide one?

-- Andy
tamagotchi
Beginner
Beginner
Posts: 6
Joined: Mon Sep 13, 2004 8:48 am

Post by tamagotchi »

Hi,

I think you can make a script to detect where the event.clientX (the X position of the mouse is) when the user clicks, and, knowing mouseX as mouse X coordinate, screenW as screenWidth and menuW as menuWidth, if mouseX>screenW-menuW then your menu should be shown with mouse pointer at the top-right corner of the menu.

You can reproduce this behavior to give you an idea on your computer desktop. Right click on it on the left edge, the menu will be displayed right to your mouse pointer. Right click on the right edge, and the menu will be displayed at the left of your mouse pointer...
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Sorry

Post by darkcircuituk »

I cant provide a url as the website is a part of the company intranet and therefore not made avaliable for outside use. The 'user' post stated clearly what I require, when a user right clicks so close to one of the edges of the screen that the menu disapeers off the screen, I wish for the menu to appear on the opposite side of the mouse pointer. For example, when the user right clicks to close to the right hand side of the screen, the menu will appear on the left side of the mouse pointer and if the user right clicks too close to the top of the screen, the menu will appear below the mouse pointer.

If you look at your sample right click menu, it portrays the same behaviour as the right click menu on our intranet (the menu disapeers off the screen).

I was wondering if you could provide any code to perform the above task.

Thank you for any help you can offer,

Dave
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Version 5.47 (going live in about 10 minutes) will fix the problem of context menus going of the page.

Cheers
Andy
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

ERRRRRR slight problem

Post by darkcircuituk »

One slight problem is that on the right hand side of the screen it works brilliantly the menu doesn't go off the screen at all, but at the bottom of the screen it takes a very novel approach of not goin off the screen. Instead of repositioning the menu back on the screen (like what happens when you right click on the right hand side of the window), it actually increases the size of the page and displays the menu in the new area.

I know this makes it hard to tell the problem but I cannot place the web address on here because its on the company intranet and therefore not avaliable to the outside world. But I can say that I believe the problem might be caused by the fact that we are using % when specifying the size of the page, but saying that, we specify the width of the page using %s too and that hasn't had the problem.

Hope you can help as always

Dave
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Sorry Guys!!!!!

Post by darkcircuituk »

Sorry guys ignore my inane babbling, I only updated one of the files rather than both. Sorry again, I'll go and stand in the corner now :oops:

Everything works great :D
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Sorry Guys!!!!!

Post by John »

darkcircuituk wrote:Sorry guys ignore my inane babbling, I only updated one of the files rather than both.
"Both"?? There are three files in the menu code, and all must be updated at the same time whenever there is a new release.
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

It's an intranet, so I'm guessing that Dave eliminated mmenuns4.js from the mix. That should make you happy John!... one more victory in the fight to rid the world of NS4!

;)

Kevin
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Post by darkcircuituk »

Yup hes right, got rid of the NS4 file, dirty netscape, bad is netscape, bbaaadddddd
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

kevin3442 wrote:It's an intranet, so I'm guessing that Dave eliminated mmenuns4.js from the mix. That should make you happy John!... one more victory in the fight to rid the world of NS4!
Thought about that, but just had to be sure.
John
Post Reply