?
Solved

Rollovers in NS

Posted on 2000-04-04
10
Medium Priority
?
206 Views
Last Modified: 2010-04-09
Hi There,
Is there any way to do text based rollovers in NS?  I have the code below for IE but I am looking for a NS equivalent:

<a href="somefile.htm" class = "off" onMouseOver = "this.className ='on'"
 onMouseOut = "this.className = 'off'">Click here</a>

The only thing that I REALLY trying to get to happen is to have the text change state in some way.  The best solution would be to have the links underline onMouseOver and have no text-decoration when off.

davlun
0
Comment
Question by:davlun20080
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2686563
Netscape sucks in the hover style...so you indeed should use onmouseover. But even then...you can't change the class-type in it. You should make a layer above it....

0
 
LVL 3

Author Comment

by:davlun20080
ID: 2686904
So in other words I would have to build a series of layers each with either the on or off state of a link, then onMouseOver to show/hide appropriate links?

davlun
0
 
LVL 3

Author Comment

by:davlun20080
ID: 2686905
Is there any way to do a src element type script to take care of the swapping automatically?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
jbirk earned 300 total points
ID: 2687475
Check out this site:
http://webreference.com/js/column4/
It has a tutorial on doing text rollovers (a color change in this case) cross browser.  You could modify that to change whatever property you wanted though:)
-Josh
0
 
LVL 1

Expert Comment

by:hkmdj
ID: 2689275
I use something that I call the NetScape Dot.  I use the CSS (NOT IE) standard a:hover and I use a mouseover that changes a dot image next to the text.  Then netscape users see the activity.

Check it at http://davidj.org/

Menu bar on the left.

David Johnson
0
 
LVL 1

Expert Comment

by:bassque
ID: 2689719
here's the code
works ver well ;-)

in between the head tags us this
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>


IN BETWEEN THE BODY TAGS USE THIS

<body bgcolor="#FFFFFF" onLoad="MM_preloadImages('up.jpg')">
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','up.jpg',1)"><img name="Image1" border="0" src="down.jpg" width="100" height="50"></a>

you'll love it
enjoy
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2689752
bassque, davlun was asking for TEXT rollovers not image rollovers...

-Josh
0
 
LVL 3

Author Comment

by:davlun20080
ID: 2689928
bassque, jbirk is correct in that I am looking for text rollovers.  I am familiar with scripts for image swapping.  Am going to reject your answer because I want to avoid images, using text instead.  

0
 
LVL 3

Author Comment

by:davlun20080
ID: 2689935
hkmdj,
Thanks for the info, however the a:hover attribute you mention is only supported in IE at this time.  Each browser has their own implementation of the CSS standard but IE is much closer to the standard.

davlun
0
 
LVL 3

Author Comment

by:davlun20080
ID: 2689938
Not the perfect solution, but good.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question