Solved

Rollovers in NS

Posted on 2000-04-04
10
196 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
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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now