Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Location
    USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    drawing a menu outside of browser window

    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.

    ---edit---
    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?
    Last edited by thegeekymonkey; 03-10-2005 at 09:07 PM. Reason: alternate option
    Anything can be solved with an extra level of indirection.

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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
    Shawn

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Location
    USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Anything can be solved with an extra level of indirection.

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    That's because the browsers menu is part of the browser, not part of the page contained in the browser.
    Shawn

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts

    Internet Explorer

    Use window.createPopup(). But that's IE only. That popup can be placed outside the window.

  • #6
    New to the CF scene
    Join Date
    Mar 2005
    Location
    USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Anything can be solved with an extra level of indirection.

  • #7
    New to the CF scene
    Join Date
    Mar 2005
    Location
    USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


    <code>
    <style>
    .menuItem{
    background-Color:green;
    border:2px outset;
    }

    .highlightItem{
    background-Color:yellow;
    border:2px outset;
    }
    </style>


    <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>
    </div>

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

    function show_menu(){
    oPopup.show(event.x,event.y,120,200);

    oPopupBody.getElementById("item1").className="highlightItem";
    }

    document.oncontextmenu=show_menu;
    </script>

    </code>

    .........................
    ........................
    Anything can be solved with an extra level of indirection.

  • #8
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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).
    *this message will self destruct in n-seconds*

  • #9
    New to the CF scene
    Join Date
    Mar 2005
    Location
    USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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()?
    Anything can be solved with an extra level of indirection.

  • #10
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by thegeekymonkey
    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
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •