RE: Javascript Rollover Question

by Rob Prentice <RJP(at)clickdms.com>

 Date:  Fri, 27 Oct 2000 09:51:24 +0100
 To:  "'Linda Engelman'" <linda(at)conciliocreative.com>,
"'hwg-techniques(at)hwg.org'" <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
hello,
 try this...

<!--
function swapImage(name)
		 {
	
if(navigator.appName=="Netscape")eval("document."+name+".src='images/nav
/"+name+"_2.jpg'");
//eval("document."+name+".src='images/nav/"+name+"_1.jpg'");
		 else
eval("document."+name+".src='images/nav/"+name+"_2.jpg'");
		 }

function restore(name)
		 {
	
if(navigator.appName=="Netscape")eval("document."+name+".src='images/nav
/"+name+"_1.jpg'");
//eval("document."+name+".src='images/nav/"+name+"_1.jpg'");
		 else
eval("document."+name+".src='images/nav/"+name+"_1.jpg'");
		 }

//-->
</script>

and on the href tag put...

onMouseOver="swapImage('tubs')" onMouseOut="restore('tubs')"

the script uses the image name for the image file names.

so if you have an imaage named tubs on the in the HTML then the file
names for the first image would be tubs_1.gif and the rollover image
will be tubs_2.gif

if you look at the code its fairly simple to alter and its a very short
peice of code compaired to a lot of other rollover scripts.

the script doesnt have a preload on it, but ive found the most realiable
preload is dreamweavers preload function. some browsers seem to have
problems with preloads. 

i hope that helps.
take care,
 Rob.

if you need anymore help in customising the code let me know. 


-----Original Message-----
From: Linda Engelman [mailto:linda(at)conciliocreative.com]
Sent: 27 October 2000 04:37
To: 'hwg-techniques(at)hwg.org'
Subject: RE: Javascript Rollover Question


Exactly what I need!  Except it doesn't work in Netscape :((
Any backup plan?

Thank you!!

Linda

At 05:34 PM 10/26/2000 -0400, Charlton, Mark wrote:
>Hi
>
>This script kind of does what you want, it changes a description when
you
>move over a link, so you should be able to easily change it for images.
>
>http://javascript.internet.com/navigation/link-description.html
>
>HTH
>Mark
>
> > -----Original Message-----
> > From: Linda Engelman [mailto:linda(at)conciliocreative.com]
> > Sent: Thursday, October 26, 2000 16:00
> > To: hwg-techniques(at)hwg.org
> > Subject: Javascript Rollover Question
> >
> >
> > Does anyone know how to do this?
> >
> > I want to be able to roll over an image and have some HTML
> > text pop up
> > somewhere else on the page.  I don't want to do this as an image
> > swap.  When I roll over image #1, there won't be a graphic
> > that pops up,
> > there will be HTML text instead.
> >
> > Why do I want to do it this way?  To increase speed of
> > loading....don't
> > want to preload a bunch of images when I can just as easily
> > do it with HTML
> > text.
> >
> > Can anyone point me to a good script for accomplishing this?
> >
> > Thanks!
> >
> > Linda
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Linda Engelman <linda(at)conciliocreative.com>
> > http://www.conciliocreative.com
> > Author, "Interacting On The Internet"
> > Contributing Writer, "Microsoft Bookshelf Internet Directory"
> > President, Concilio Creative Group, Web Page
> > Development/Internet Training
> >

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.