View Full Version : drawing a menu outside of browser window

03-10-2005, 08:06 PM
As I am a new member on this forum, I would like to say 'hello' to everyone first.

I am currently designing a custom menu (which is triggered with the right mouse click). The problem is that the menu will only appear within the browser window, which is okay if the browser window is large enough to show the full menu. But when the window is resized to be smaller than the menu itself, part of the menu will be hidden (cut off) inside the browser window. I'm trying to make the menu so that it is able to be displayed outside of the browser window when the window size is too small to display the whole menu. Is there a method in javascript which can cause something to be displayed outside of the browser window? I have searched this forum but to no avail. Any help will be appreciated. Thank you.

Or, I can display a popup window. I've tried this method also, but it doesn't look good. It doesn't look like an authentic menu because the popup window contains the title bar and the minimize, maximize, and close buttons at the top. I'm able to get rid of scrollbars, status bar, location bar, menu bar, etc but I just can't get rid of the title bar. Any suggestion on how to get rid of the title bar and the buttons at the top right corner?

03-10-2005, 10:18 PM
Making the menu appear out of the browser window is to my knowledge impossible. As for removing the title bar, I don't think you can either... Sorry

03-10-2005, 10:45 PM
The browser's default menu is able to pop out of the window if the size of the browser windo is too small. I've been searching the web the whole day now, but I couldn't find any information on how to do it.

03-11-2005, 05:09 AM
That's because the browsers menu is part of the browser, not part of the page contained in the browser.

03-11-2005, 06:59 AM
Use window.createPopup() (http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/createpopup.asp). But that's IE only. That popup can be placed outside the window.

03-11-2005, 08:25 PM
Thanks, glenngv. I'll take a look into that function. You mentioned that this method only works in IE, is there a similar function for Mozilla/Netscape???

Thank you to everyone who have replied.

03-16-2005, 09:19 PM
Can CSS be used with popup menus? For example, can the following code be done? I'm having trouble assigning className to and object and have it display correctly. What I mean is that althought the className is set, it does not display accordingly.

border:2px outset;

border:2px outset;

<div id="menu" style="display:none">
<div id="item1" class="menuItem">File</div>
<div id="item2" class="menuItem">Open</div>
<div id="item3" class="menuItem">Show</div>

<script language=javascript>
var oPopup=window.createPopup();
var oPopupBody=oPopup.document.body;

function show_menu(){





03-16-2005, 09:51 PM
You may have to set/insert that prior to popping it up... also, as of SP2, the default security settings prevent popups from extending beyond the viewport (they'll just get 'squished' at the edge of the document).

03-17-2005, 02:47 AM
OK, I'm not doing the style sheet with createPopup anymore. There's just too much problem. I'll find a way to work around it.

But I have a new question. Is it possible to create two popups in the same window using createPopup()?

03-17-2005, 11:43 AM
But I have a new question. Is it possible to create two popups in the same window using createPopup()?

Everything you ever wanted to know about popups is disclosed here: Using the Popup Object (http://msdn.microsoft.com/workshop/author/om/popup_overview.asp)