Onmouseover for complete novice

C

CQMMAN

Using IE6, trying to get text to change when I move the mouse over it by
using the following code:

<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>

Unfortunately, it isn't working and I can't figure out why.

Any ideas?

thanks
 
M

Michael Wilcox

CQMMAN said:
Using IE6, trying to get text to change when I move the mouse over it
by using the following code:

<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>

Try some CSS. In your <head>, put:

<style type="text/css">
a:hover
{
color: #FF0010;
}
</style>

and then just make a normal link:

<a href="#">that</a>
 
S

Sid Ismail

: Using IE6, trying to get text to change when I move the mouse over it by
: using the following code:
:
: <a href="#"
: onmouseover="setText('this')"onmouseout="setText('other')">that</a>
:
: Unfortunately, it isn't working and I can't figure out why.


Why is a complete novice meddling with this Javascript crap?

Sid
 
W

William Tasso

Sid said:
Why is a complete novice meddling with this Javascript crap?

because:

o incomplete novices can't
o those with moderate skill no longer bother

does that help?
 
T

Toby A Inkster

CQMMAN said:
<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>
^
First of all, you need a space where I have indicated.

Second of all, this isn't a link, so use <span> instead of <a>.

Third of all, can we see where you have defined setText()?
 
C

CQMMAN

Sid Ismail said:
: Using IE6, trying to get text to change when I move the mouse over it by
: using the following code:
:
: <a href="#"
: onmouseover="setText('this')"onmouseout="setText('other')">that</a>
:
: Unfortunately, it isn't working and I can't figure out why.


Why is a complete novice meddling with this Javascript crap?

Sid


Any suggestions on doing this with HTML then?
 
H

Hywel Jenkins

Using IE6, trying to get text to change when I move the mouse over it by
using the following code:

<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>

Unfortunately, it isn't working and I can't figure out why.

Any ideas?

What does setText() do? We're not mind readers, you know.
 
C

CQMMAN

Hywel Jenkins said:
What does setText() do? We're not mind readers, you know.


Well I thought it was a command to change the text at that location. Sorry,
to be honest, I thought this would be a helpful group but with comments like
yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
somewhere else.

Until everyone is born knowing HTML, we all have to start somewhere.
 
T

Toby A Inkster

CQMMAN said:
Well I thought [setText()] was a command to change the text at that
location.

Well it's not. It's just a meaningless function name. You need another bit
of Javascript to define what setText() does.

That's why I said:
| Third of all, can we see where you have defined setText()?
Sorry, to be honest, I thought this would be a helpful group but with
comments like yours ("We're not mind readers, you know.") and Sid's,
pehaps I need to go somewhere else.

I think that a Javascript newsgroup might be more appropriate for your
needs than an HTML one.
 
L

Leif K-Brooks

CQMMAN said:
Well I thought it was a command to change the text at that location. Sorry,
to be honest, I thought this would be a helpful group but with comments like
yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
somewhere else.

But we *aren't* mind readers. How were we supposed to know that you
thought setText() would do that?
 
S

Sid Ismail

: >
: >
: > Why is a complete novice meddling with this Javascript crap?
: >
: > Sid
: >
:
:
: Any suggestions on doing this with HTML then?
:


That's why I said "crap" - plse do not. :))

Sid
 
C

CQMMAN

Leif K-Brooks said:
But we *aren't* mind readers. How were we supposed to know that you
thought setText() would do that?

By reading the top of my post where I wrote:

"Using IE6, trying to get text to change when I move the mouse over it by
using the following code:"

I though that "trying to get the text to change" and "using the following
code" would give it away. I really don't expect to have to explain what this
means word for word. We all have a reasonable grasp of English otherwise we
wouldn't be using this newsgroup.
 
L

Leif K-Brooks

CQMMAN said:
By reading the top of my post where I wrote:

"Using IE6, trying to get text to change when I move the mouse over it by
using the following code:"

You didn't say where you thought the setText() function would come from,
though. For all we knew, you were defining it yourself.
 
I

Ixon

U¿ytkownik "CQMMAN said:
Using IE6, trying to get text to change when I move the mouse over it by
using the following code:

<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>

Unfortunately, it isn't working and I can't figure out why.

Any ideas?

thanks
MAybe try this. It's not the best solution I think, but it works very
good :)


<html>
<head>
<title>Untitled</title>

<style type="text/css">

#layer1, #layer2{
position:absolute;
left:10;
top:10;
cursor:hand;
}
</style>
</head>

<body>

<div id="layer1" style="visibility:visible"
onMouseover="this.style.visibility='hidden';
document.all['layer2'].style.visibility='visible'">something</div>
<div id="layer2" style="visibility:hidden"
onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
e.visibility='visible'">else</div>


</body>
</html>

Contents of both div's ('something' and 'else') may be links of
course.

Ixon- [PL]
 
C

CQMMAN

<html>
<head>
<title>Untitled</title>

<style type="text/css">

#layer1, #layer2{
position:absolute;
left:10;
top:10;
cursor:hand;
}
</style>
</head>

<body>

<div id="layer1" style="visibility:visible"
onMouseover="this.style.visibility='hidden';
document.all['layer2'].style.visibility='visible'">something</div>
<div id="layer2" style="visibility:hidden"
onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
e.visibility='visible'">else</div>


</body>
</html>

Contents of both div's ('something' and 'else') may be links of
course.

Ixon- [PL]

Thanks for that, I will give it a shot..
 
D

David Dorward

Ixon wrote:


Missing doctype
<html>
<head>
<title>Untitled</title>

<style type="text/css">

#layer1, #layer2{

/* Useless name */
position:absolute;
left:10;

/* Missing unit */

/* Missing unit */
cursor:hand;

/* Invalid, IE 5 specific junk. Use pointer */
}
</style>
</head>

<body>

<div id="layer1" style="visibility:visible"
onMouseover="this.style.visibility='hidden';
document.all['layer2'].style.visibility='visible'">something</div>
<div id="layer2" style="visibility:hidden"
onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
e.visibility='visible'">else</div>

document.all is IE specific, you should use DOM

Browsers without CSS support will display both versions at once.
 
D

Disco Octopus

CQMMAN said:
Using IE6, trying to get text to change when I move the mouse over it
by using the following code:

<a href="#"
onmouseover="setText('this')"onmouseout="setText('other')">that</a>

Unfortunately, it isn't working and I can't figure out why.

Any ideas?

thanks

you could play around with something like this......
not javascript, and I imagine something along these lines would be much more
widely accesible than a js ready browser......


a {position:absolute;top:0;left:10; background-color:white; height:170px;}
a:hover {height:30px;}
div {position:absolute;top:50px;left:10px;}
..............

<div>lll</div>
<a href="#">asdf</a>
 
I

Ixon

.....
<div id="layer1" style="visibility:visible"
onMouseover="this.style.visibility='hidden';
document.all['layer2'].style.visibility='visible'">something</div>
<div id="layer2" style="visibility:hidden"
onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
e.visibility='visible'">else</div>

document.all is IE specific, you should use DOM

Browsers without CSS support will display both versions at once.
http://dorward.me.uk/


Could you rewrite my example using DOM, please ?
 
H

Hywel Jenkins

Well I thought it was a command to change the text at that location.

It may well be - how do we know? Apparently you're the only person that
can know for sure.
Sorry,
to be honest, I thought this would be a helpful group but with comments like
yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
somewhere else.

Perhaps. Bye.

Until everyone is born knowing HTML, we all have to start somewhere.

Especially when you're asking a JavaScript question. If you don't know
what it does, don't use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top