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

Thread: popup

  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    popup

    I have a popup window using oPopup and the menu is created using <div> in my html code. Here is my javascript code:

    Code:
    function richDropDown(a,b,c,d,e,menu_name)
    {   
       oPopup.document.body.innerHTML = menu_name.innerHTML;
       oPopup.show(a,b,c,d,e);
       //oPopup.onmouseout=oPopup.hide();
    }
    I am wondering how to get the popup menu to dissapear automatically once the mouse has left the popup without having to click.

  • #2
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if onmouseout will work, how do I use that in javascript. It will not work from inside the HTML, because the <div> does not seem to be a single object. It is a list of a bunch of them. If you know what I mean??

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    does anyone understand my question or do I need to explain better?

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    lets see it all

    i think i understand but i need to see it all, so if you have a link to it or can pos it all please do.

  • #5
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <html>
    <head>
    <title>MY popup menu</title>
    
    <script>
    var oPopup = window.createPopup();
    function richDropDown(a,b,c,d,e,menu_name)
    {
    		oPopup.document.body.innerHTML = menu_name.innerHTML;
    		oPopup.show(a,b,c,d,e);		
    }
    
    <p><img src="Picture1.gif" width="800" height="600" border="0" usemap="#Map">
    
      <map name="Map">  	
    <area id=MTU_MAP shape="rect" coords="91,275,171,316" alt="click" onmousedown="richDropDown(30,30,220,150,MTU_MAP,MTU_MENU)"
    	onmouseover="document.body.style.cursor='hand'; " 
    	onmouseout="document.body.style.cursor=''; ">
    	
      </map>
    
    <DIV ID="MTU_MENU" STYLE="display:none" >
    
    <DIV STYLE="font-family:verdana; font-size:80%; height:30px; background:#0066FF; border:1px solid black; padding:0px; text-align:center; border:2px solid black; cursor:hand;">
       	&nbsp <img src="tridown.gif" align="left"><font size="+1">  <B>MTU Menu&nbsp</B> </font> <img src="tridown.gif" align="right">
        </DIV>
    
    <div style="position:absolute; top:30; left:0; overflow:scroll; overflow-x:hidden; width:220; height:120; scrollbar-base-color:#3366CC; border-bottom:2px solid black; SCROLLBAR-HIGHLIGHT-COLOR: #99CCFF; SCROLLBAR-ARROW-COLOR:white;">
    
        <DIV onmouseover="this.style.filter='progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#99ccff, EndColorStr=#FFFFFF)'; this.style.color='red' ;
    		this.style.fontSize='14'; " 
             onmouseout="this.style.filter=''; this.style.color='black'; this.style.fontSize='12'; "
             STYLE="font-family:verdana; font-size:70%; height:25px; background:#e4e4e4; border:1px solid black; padding:3px; padding-left:20px; cursor:hand;">
        <SPAN ONCLICK="">
        OV-103</SPAN>
        </DIV>
    	</DIV>
    	</DIV>
    
    
    </body>
    </html>
    I guess you don't have the image file, it uses map then when clicked a dropdown menu opens. Let me know if you know how to solve my problem. THANKS!!

  • #6
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    question

    ok, so the pop up is a window or the div?


    if its a div thats easy to do, just set an onmouseout to the actual div.

    <div id=MTU_MENU onmouseout="this.style.visibility='hidden';">

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    oPopup.onmouseout=oPopup.hide;

  • #8
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by brandonH
    ok, so the pop up is a window or the div?


    if its a div thats easy to do, just set an onmouseout to the actual div.

    <div id=MTU_MENU onmouseout="this.style.visibility='hidden';">
    One would think that would work, but I have <DIV ID="MTU_MENU" STYLE="display:none" > and it won't work with that. It's the javascript that actually shows the menu.

    Another thing my <div> menu doesn't seem to be in a single container. Even when I did it the way you said to it only pertained to the first first div element. I only saw that that worked by taking out the STYLE="display:none"

    Thanks for your help this has been bothering me for a while!!

    PS: is there a way to put my whole div in one container?

  • #9
    New Coder
    Join Date
    Mar 2005
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by glenngv
    oPopup.onmouseout=oPopup.hide;
    thanks glenngv. I tried that before and just did again, but I keep getting an error on page. I put that in the same function as where I created the popup. Is that what you would do?
    Code:
    function richDropDown(a,b,c,d,e,menu_name)
    {
       oPopup.document.body.innerHTML = menu_name.innerHTML;
       oPopup.show(a,b,c,d,e);
       oPopup.onmouseout=oPopup.hide;	
    }

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    What error message?


  •  

    Posting Permissions

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