Richard wrote:
On Fri, 07 Jan 2005 22:31:17 -0500 Randy Webb wrote:
Richard wrote:
I know I can have like <a href="#" onclick="dothis"
onmouseover="dothat">
But how do you properly code two mouseover's in one statement?
<a href="#" onmousever="dothis" onmouseover="dothat">
<a href="#" onmouseover="doThis();doThat()">
<a href="#" onmouseover="doBoth()">
function doBoth(){
doThis();
doThat();
}
Would this work then?
onmouseover="changetext(content[1]);changetext(content[2])"
Test it and see :-)
But what I aiming at doing is, having the content in two seperate divisions
change at the same time.
So perhaps I could have:
onmouseover="changetext(content[1]);changeimage(content[2])"
Lets say you have a div tag with id="myDiv" and an image with
name="myImage". If you want to change it, then you pass a single
parameter to a single function that then changes it all.
var content = new Array()
content[0] = ['...','...'];
content[1] = ['...','...'];
content[2] = ['...','...'];
content[3] = ['...','...'];
function changeIt(param({
document.getElementById('myDiv').innerHTML = content[param][0];
document.images['myImage'].src = content[param][1];
}
<a href="#" onmouseover="changeIt(1)" onmouseout="changeIt(0)
onclick="return false">Change it to 1</a>
<a href="#" onmouseover="changeIt(2)" onmouseout="changeIt(0)
onclick="return false">Change it to 2</a>
<a href="#" onmouseover="changeIt(3)" onmouseout="changeIt(0)
onclick="return false">Change it to 3</a>
And so on.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq