Results 1 to 6 of 6

Thread: onMouseOut problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13

    onMouseOut problem

    I am having a small problem with the mouse out for the menu. When the mouse is on top of the image, (the image changes and the menu pops out). When I move the mouse on top of the menu (The image changes back to original).

    What can i do so that when the mouse is on top of the menu (the image doesn't change until the mouse is out of the menu).

    here is the code:

    Code:
     ><A onmouseover="MM_swapImage('serv_software_technology','','images/serv_software_technology_over.gif',1);MM_showMenu(window.MenuSoftware_Technology,172,0,null,'serv_software_technology')" onmouseout="MM_swapImgRestore();MM_startTimeout();" href="http://www.alphe.com/software_technology/"><IMG src="images/serv_software_technology.gif" border=0 name=serv_software_technology></A>

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    I would encase the image and the menu is a <span> tag. then move the onMouseOut effect from the imge to this tag. So now, when they move the mouse off the span tag, which holds the image and the menu, the image reverts back to normal and the menu also goes back to normal.
    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13
    Some thing like this... If not please show me what you mean. Because this is not working the way i am doin it.


    Code:
    <span onmouseout="MM_swapImgRestore()><A onmouseover="MM_swapImage('serv_software_technology','','images/serv_software_technology_over.gif',1);MM_showMenu(window.MenuSoftware_Technology,172,0,null,'serv_software_technology')" MM_startTimeout();" href="http://www.alphe.com/software_technology/"><IMG src="images/serv_software_technology.gif" border=0 name=serv_software_technology></A></span>

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    yes, like that but the function is built to run from an image, so that will have to be re-written.

    make it something like this (depending on how you expand the menu).

    Code:
    <span onMouseOut="runThis(this)">.......</span>
    
    then...
    
    
    <script>
    function runThis(_obj) {
    HTML = "<img src="origpic.jpg">
    _obj.innerHTML = HTML
    }
    </script>
    Have I helped you? Please Rate my posts.

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13
    This is what the function is set to:

    [code]
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    [/coce]

  6. #6
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    ok replace that with:
    Code:
    function swap(_obj,img) {
    _obj.src = img
    }
    
    function make_menu() {
    /*keep this as it was
    this obviously makes the menu.
    */
    }
    
    then make the image like this:
    <img src="orig.jpg" onMouseOver="swap(this,'new.jpg'),make_menu()">
    Have I helped you? Please Rate my posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width