Text rollover please! :)
Hi folks,
I need aquick script by tonight if pos or whenever anyone reads this...
I would like the following:
» <a href="link">text</a>
[the link is a rollover with CSS and I want the » to become red as the mouse passes over the text]
Could anyone to do this?
cheers,
JP
PS: it does not have to be Netscape copm.
John Pollock posted this at 23:16 — 13th December 1999.
He has: 628 posts
Joined: Mar 1999
Well, since NS compatibility isn't needed, here you go. Adjust the color names to your liking.
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--
function change_it(span_id,the_color)
{
var insert_span_id= eval("document.all."+span_id);
insert_span_id.style.color=the_color;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<P>
<SPAN ID="first" style="color:black">»</SPAN> <a href="link" onMouseover="change_it('first','red');" onMouseout="change_it('first','black');">text</a>
<P>
<SPAN ID="second" style="color:black">»</SPAN> <a href="link" onMouseover="change_it('second','red');" onMouseout="change_it('second','black');">text</a>
<P>
John is awesome.
</BODY>
</HTML>
The last part of the body section is optional, of course. Ha!
Java Script: A Beginner's Guide
Page Resource
Anonymous posted this at 00:38 — 14th December 1999.
They have: 5,633 posts
Joined: Jan 1970
I just wish there was an easy way to do the same thing in Netscape. I am having a hard time at the moment getting layers to work in both IE & NN. I think I need to go out and buy a good Dhtml book. Any suggestions?
------------------
http://go.to/hass
John Pollock posted this at 01:20 — 14th December 1999.
He has: 628 posts
Joined: Mar 1999
I'm with you on that one. But until NS recognizes certain things as objects, it probably just can't do what we want it to. If anyone does know a good book, do post it-- I'm sure both of us would like to read it.
Java Script: A Beginner's Guide
Page Resource
cds posted this at 07:13 — 14th December 1999.
They have: 359 posts
Joined: Mar 1999
John,
You were referring to John Stones, weren't you?
Dan
John Pollock posted this at 16:31 — 14th December 1999.
He has: 628 posts
Joined: Mar 1999
Well, yes... of course I was..LOL
JP Stones posted this at 21:37 — 15th December 1999.
They have: 2,390 posts
Joined: Nov 1998
cheers John, all - much apreciated.
JP
JP Stones posted this at 23:51 — 22nd December 1999.
They have: 2,390 posts
Joined: Nov 1998
ah, came across a problem:
When I use:
...all works fine, but when I use:
...nothing works! Anyone got an explanation?
cheers,
JP
PS: It might be simple as I have just come back from 16 hours at work
Anonymous posted this at 00:34 — 23rd December 1999.
They have: 5,633 posts
Joined: Jan 1970
You can't use the same id="NAME" for each span.
------------------
http://go.to/hass
Anonymous posted this at 01:09 — 23rd December 1999.
They have: 5,633 posts
Joined: Jan 1970
I don't know if that is what you want but here you go anyway. Put that in the <head></head> tags. Also change the colors to what you want. What this script does is have non-underlined text change over to a different color when a mouse moves over it. Also you don't need any special stuff in the link code just put in a normal link code and this should work.
<style><!--
A:link {text-decoration: none; font-family: arial; color: red}
A:visited {text-decoration: none; font-family: arial; color: red}
A:hover {text-decoration: none; font-family: arial; color: yellow}
-->
</style>
Your welcome,
~Park~
------------------
ICQ-54455232
E-mail- [email protected]
http://photolink.hypermart.net/pstuff2/
JP Stones posted this at 19:35 — 24th December 1999.
They have: 2,390 posts
Joined: Nov 1998
thanks all, sorry for wasting your time with a silly question
JP
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.