Text Change
Hello. Hope you all are having a great Christmas! Well, I want to know if there is any script that would do the following:
Let's say I have the word "Weapons" (It's a link)
When the mouse goes over it, I want Weapons to change to [Weapons]
Weapons = [Weapons]
Thanks.
IanD posted this at 03:20 — 27th December 1999.
They have: 222 posts
Joined: Sep 1999
This is just off the top of my head, so bear w/ me...
You could assign the link a variable name, and in your style sheet do something like:
Or something... The syntax on that is probably wrong, but something along those lines might work.
Fighting for a Lost Cause.net
RC posted this at 14:05 — 3rd January 2000.
They have: 89 posts
Joined: Sep 1999
Try this. It works in IE 5 and NS 4.7. I offer no promises for older versions.
<HTML>
<HEAD>
<STYLE TYPE="text/css"><!--
A:link {text-decoration: none; color: green}
A:visited {text-decoration: none; color: green}
A:active {text-decoration: none; color: green}
//--></STYLE>
<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,text) {
if (dhtml == 'IE') {
eval(object + '.innerText = text');
}
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,text) {
if (dhtml == 'IE') {
eval(object + '.innerText = text');
}
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,txet) {
if (dhtml == 'IE')
document.write('<A HREF="'+href+'" onMouseOut="mout(\'link'+no+'\',\''+txet+'\')" onMouseOver="mover(\'link'+no+'\',\''+text+'\')" ID="link'+no+'">'+txet+'<\/A>');
else if (dhtml == 'NN')
document.write('<LAYER NAME="link'+no+'a" VISIBILITY="hide"><A HREF="'+href+'" onMouseOut="mout(\'link'+no+'\')">'+text+'<\/A><\/LAYER><LAYER NAME="link'+no+'b"><A HREF="'+href+'" onMouseOver="mover(\'link'+no+'\')">'+txet+'<\/A><\/LAYER>');
else
document.write('<A HREF="'+href+'">'+text+'<\/A>');
document.write('<BR>');
no+=1;
}
//--></SCRIPT>
</HEAD>
<BODY bgcolor="black">
<SCRIPT>
dLink('blah.html','[Weapons]','Weapons');
</SCRIPT>
</body>
</html>
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.