Solved

Rollovers in NS

Posted on 2000-04-04
10
203 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 100 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need Assistance Implementing ShockWaveFlash Object in Excel VBA 3 32
Debugging Html 8 43
Sticking text to shapes in Raphael.js 6 41
Jquery syntax 12 29
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

738 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