472,952 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 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 2225
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.