|
-
Dec 13th, 2000, 07:49 PM
#1
Thread Starter
Fanatic Member
hello,
I have an <a href> on the left side of my screen.
on the right side I have some text. I want to have javascript that works in both browser and when I roll over the <a href> the text on the right side of the screen will change.
I have tried using the <div ID="newText">
and <layer ID="newText">but I can only get it to work in one browser or the other not both.
I haven't include my code becouse I think it is so messed up it will just mess you up worse than not seeing it at all.
if this makes no sense let me know and I will rewrite it so it is easyier to understand.
basicly I want to do what you could do w/ an image swap only I want to use text.
thanks
-
Dec 15th, 2000, 04:52 AM
#2
Frenzied Member
this works with IE and Netscape 4
Code:
<HTML>
<HEAD>
<script language=javascript>
var ntext;
var otext;
function init()
{
if (document.all) {ntext = object1.style}
if (document.all) {otext = object2.style}
if (document.layers) {ntext = document.object1}
if (document.layers) {otext = document.object2}
}
function oldText()
{
otext.visibility = 'hidden';
ntext.visibility = 'visible';
}
function newText()
{
ntext.visibility = 'hidden';
otext.visibility = 'visible';
}
</script>
</HEAD>
<BODY onLoad="init()">
<a href="" onMouseover="newText()" onMouseout="oldText()">click here</A>
<div ID="object1" STYLE="position:absolute;top:10;left:270">
Old Text
</div>
<div ID="object2" STYLE="position:absolute;top:10;left:270;visibility:hidden">
new text
</div>
</BODY>
</HTML>
-
Dec 15th, 2000, 11:50 AM
#3
Thread Starter
Fanatic Member
thank!
thanks a bunch,
that is super cool.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|