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="dot his" onmouseover="do that">
<a href="#" onmouseover="do This();doThat() ">
<a href="#" onmouseover="do Both()">
function doBoth(){
doThis();
doThat();
}
Would this work then?
onmouseover="ch angetext(conten t[1]);changetext(co ntent[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="ch angetext(conten t[1]);changeimage(c ontent[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.getEle mentById('myDiv ').innerHTML = content[param][0];
document.images['myImage'].src = content[param][1];
}
<a href="#" onmouseover="ch angeIt(1)" onmouseout="cha ngeIt(0)
onclick="return false">Change it to 1</a>
<a href="#" onmouseover="ch angeIt(2)" onmouseout="cha ngeIt(0)
onclick="return false">Change it to 2</a>
<a href="#" onmouseover="ch angeIt(3)" onmouseout="cha ngeIt(0)
onclick="return false">Change it to 3</a>
And so on.
--
Randy
comp.lang.javas cript FAQ -
http://jibbering.com/faq