Click to See Complete Forum and Search --> : Combining 2JavaScripts with 2Mouseon Events


Four_of_Five
09-29-2003, 04:35 PM
Hi,

I'm trying to "combine" two JavaScripts, each with it's own Mouseover/Mouseout events...

[/b]The first one basically slides out a menu and has this for MouseEvents:[/b]

_______________
<td class="txt" onmouseover="changeBG(this,'#ff0000')" onmouseout="changeBG(this,'#0099CC')"><a href="#">home</a></td>
__________________

The other one, has this to produce sounds on Mousevents:

______________
<a href="#" onmouseover="playSound(0)" onmouseout="stopSound(1)" onclick="playSound(1)">1MOUSE-OVER THIS LINK TO PLAY SOUND</A>
_____________________

How can I combine the 2 to make them work both at the same time, wherein as soon as I slide out a menu and mouseover links (both outside and inside) it'll produce the same results? You may want to look at the attached TXT file for the entire script...(btw, the SoundOnMouseOver part doesn't work at all)

Four_of_Five
09-29-2003, 04:45 PM
Btw, I have made the following "failed" combinations:

_____________________________

<body onload="slideMenuInit()">

<table id="menu" width="180" border="1" cellpadding="3" cellspacing="0" bgcolor="#0099CC" bordercolor="#FFFF00" onmouseover="slideIn()" onmouseout="slideOut()">
<tr>
<td class="txt" onmouseover="changeBG(this,'#ff0000');playSound(0)" onmouseout="changeBG(this,'#0099CC');playSound(1)" onclick="playSound(2)"><a href="#">home</a></td>
<td rowspan=6 class="txt">M<br/>E<br/>N<br/>U</td>
</tr>

<tr>
<td class="txt" onmouseover="changeBG(this,'#ff0000')" onmouseout="changeBG(this,'#0099CC')"><a href="#" onmouseover="playSound(2)" onmouseout="stopSound(3)" onclick="playSound(3)">dhtml scripts</a></td>
</tr>
_________________________________

Neither of which worked :(

Four_of_Five
10-04-2003, 03:08 AM
BUMP UP :rolleyes:

maybe some1 has answers already?

Thanks!

alantis13
10-04-2003, 04:19 AM
http://www.javascriptkit.com/javatutors/multiplejava3.shtml

Four_of_Five
10-05-2003, 02:02 PM
Although it didn't actually solve my problem outright...your link certainly reminded me where to look :D Thanks!

I simply tried adding another <body onload> function to the other javascript onload functions I already had on the page...(though it wasn't really part of the original scripting)