help me!!! I'm desperate!!!!

How do I turn text different colors for rollovers without using graphic images?

Thanks,
Hungry Fish.
jlanimatorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbeavenCommented:
In the head of your document
<STYLE type="text/css">
<!--
A:hover {color: blue}
-->
</STYLE>

Only works in IE
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jlanimatorAuthor Commented:
Thank You SOOOOOOOO much!!!!!!! You were EXTREMELY HELPFUL!!!!!!!!!!!!! WAHOOOOOO!!!!!
0
mbeavenCommented:
What are ya, a freak?
0
rdivilbissCommented:
You can do this with CSS, except NS does not use the hover attribute which means it will not display the effect.  The following bit of code will work for both IE and NS.

If you do not want the text to be a link, use a href="#".  Note: You just copy and paste the code into the head.  Everyplace you want the rollover text in your page body you call the function
thus:

<script>dLink('#','Rollover Text Here');</script>




<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript"><!--
var dhtml = '', no = 0;
if (navigator.appVersion.charAt(0) == "4") {
    if (navigator.appVersion.indexOf("MSIE") != -1)
        dhtml = 'IE';
    else
        dhtml = 'NN';
}      

function mover(object) {
    if (dhtml == 'IE') {
        eval(object + '.style.color = "red"');
        eval(object + '.style.fontSize = "100%"');
    }
    else if (dhtml == 'NN') {
        eval('document.layers["' + object + 'b"].moveBelow(document.layers["' + object + 'a"])');
        eval('document.layers["' + object + 'b"].visibility="hide"');
        eval('document.layers["' + object + 'a"].visibility="show"');
    }
}

function mout(object) {
    if (dhtml == 'IE') {
        eval(object + '.style.color = "blue"');
        eval(object + '.style.fontSize = "100%"');
    }
    else if (dhtml == 'NN') {
        eval('document.layers["' + object + 'a"].moveBelow(document.layers["' + object + 'b"])');
        eval('document.layers["' + object + 'a"].visibility="hide"');
        eval('document.layers["' + object + 'b"].visibility="show"');
    }
}

function dLink(href,text) {
    if (dhtml == 'IE')
        document.write('<A HREF="'+href+'" onMouseOut="mout(\'link'+no+'\')" onMouseOver="mover(\'link'+no+'\')" ID="link'+no+'">'+text+'<\/A>');
    else if (dhtml == 'NN')
        document.write('<LAYER NAME="link'+no+'a" VISIBILITY="hide"><A HREF="'+href+'" onMouseOut="mout(\'link'+no+'\')" CLASS="different">'+text+'<\/A><\/LAYER><LAYER NAME="link'+no+'b"><A HREF="'+href+'" onMouseOver="mover(\'link'+no+'\')" CLASS="normal">'+text+'<\/A><\/LAYER>');
    else
        document.write('<A HREF="'+href+'">'+text+'<\/A>');
    document.write('<BR>');
    no+=1;
}
//--></SCRIPT>

<STYLE TYPE="text/javascript"><!--
    classes.different.A.color = "red";
    classes.different.A.fontSize = "100%";
    classes.normal.A.color = "blue";
//--></STYLE>

<title>Cross-Browser Hover Text Link</title>

</HEAD>
<BODY>
<script>dLink('default.htm','A Cross Browser Hover Link in Javascript');</script>


</BODY>

Cheers,
Rod


Some live examples of other methods can be found here:

http://www.cssnetworks.com/test/mouse_over.htm

0
jlanimatorAuthor Commented:
WHATEVER MBEAVEN!!!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.