473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

onmouseover question

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

As an example of use:
Column A holds menu items.
When a mouse over is performed, two actions take place instead of one.
Action one sends an image to a division in column B, action two sends text
to another division in column B.

What's the trick?

I am searching google for the answer as well.
Jul 23 '05 #1
7 2246
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()">
OR:
<a href="#" onmouseover="doBoth()">

function doBoth(){
doThis();
doThat();
}

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
On Fri, 7 Jan 2005 20:57:11 -0600 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"> As an example of use:
Column A holds menu items.
When a mouse over is performed, two actions take place instead of one.
Action one sends an image to a division in column B, action two sends
text
to another division in column B. What's the trick? I am searching google for the answer as well.


Ok. Sort of found the solution I guess. Simple enough.

onmouseover="dothis" ; "do that"
Now all I need to do is to figure out how to place the two actions in the
proper divisions.
Jul 23 '05 #3
Richard wrote:
[...]
onmouseover="dothis" ; "do that"


Bzzzzt. "do that" will not be called.

As Randy posted:

onmouseover="dothis(); dothat()"

--
Rob
Jul 23 '05 #4
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();
}


Thanks Randy.
I figured it was purely in the syntax thing.

Jul 23 '05 #5
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();
} --
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq

Would this work then?

onmouseover="changetext(content[1]);changetext(content[2])"

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

Jul 23 '05 #6
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
Jul 23 '05 #7
On Sat, 08 Jan 2005 02:27:15 -0500 Randy Webb wrote:
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.


Thanks Randy. I'll figure it out eventually.

Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim | last post by:
Hope someone in the big wide world can help... What I want to do is have an image slideshow which automatically scrolls through a series of images very fast, then pauses when you move your mouse...
7
by: windandwaves | last post by:
Hi Gurus I am trying to make this rather complicated maps with an a huge number of mouseovers and the like. I want to set up a function that OnMouseDown swaps the OnMouseOver and OnMouseOut for...
2
by: news.west.cox.net | last post by:
I have been writing a practice sliding div navigation script. I am finding myself in the position where I need to force a div into showing the hover behavior defined in css. So my question is...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
1
by: Ciuin | last post by:
Again I need your help. This is the test page I am working on: http://www.manfredkooistra.de/zeugs/test/test.php Description: The page shows a centered image and a navigation menue...
1
by: Goutour | last post by:
Hello, I am a 2-day old Javascript developer :-) and I have a problem. I am trying to do examples I find on net about using onmouse events. I found a javascript that generates flying objects, and I...
3
by: Laser Lips | last post by:
HI All, Is it possible to do the following? object = document.getelementById('something'); object.onmouseover='alert("hi");'; ...................
4
by: bgold12 | last post by:
Hey, I have kind of a weird problem. I have a span that I'm intentionally overflowing a table cell (<td>), so that it stretches over the table cells to the right of the parent table cell. I want...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.