PDA

Click to See Complete Forum and Search --> : onMouseOut problem


amitonic
Apr 13th, 2004, 03:06 PM
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:

><A onmouseover="MM_swapImage('serv_software_technology','','images/serv_software_technology_over.gif',1);MM_showMenu(window.MenuSoftware_Technology,172,0,null,'serv_so ftware_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>

Acidic
Apr 13th, 2004, 03:42 PM
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.

amitonic
Apr 13th, 2004, 03:55 PM
Some thing like this... If not please show me what you mean. Because this is not working the way i am doin it.



<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_so ftware_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>

Acidic
Apr 13th, 2004, 04:11 PM
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).


<span onMouseOut="runThis(this)">.......</span>

then...


<script>
function runThis(_obj) {
HTML = "<img src="origpic.jpg">
_obj.innerHTML = HTML
}
</script>

amitonic
Apr 13th, 2004, 04:49 PM
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]

Acidic
Apr 13th, 2004, 04:55 PM
ok replace that with:

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()">