Click to See Complete Forum and Search --> : Looking for assistance
Keone
04-05-2003, 10:28 AM
Just starting to get into JavaScript. Having moderate success, but have run into a brick wall on one item. In what should be a fairly simple effect (image flip using onMouseOver and Preloading images) I cannot get the "new" image to display. I get the x box. Additionally, onMouseOut does not return the original image. My script is in FrontPage 2002 HTML view. Browser is IE 6.0 Any thoughts? Can I send my code to someone? Thanks.
khalidali63
04-05-2003, 10:36 AM
Take a look at this link.
hope this helps
http://68.145.35.86/skills/javascripts/DisplayTwoImagesClickOver.html
Cheers
Khalid
Keone
04-05-2003, 10:46 AM
Thanks Khalid. I looked at that, but I think its too advanced for me at the moment. Any issue if I place my code in here so someone could take a look?
Keone
04-05-2003, 10:59 AM
This is the code. I've also attached one of the four image files. Thanks for any assistance.
<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Tester</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none, default">
<SCRIPT LANGUAGE="javascript">
pic1on= new Image(32,32)
pic1on.src="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Home_On.gif"_
pic2on= new Image(32,32)
pic2on.src="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Directory_On.gif"
pic1off= new Image(32,32)
pic1off.src="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Home_Off.gif"
pic2off= new Image(32,32)
pic2off.src="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Directory_Off.gif"___
</SCRIPT>
</HEAD>
<BODY bgcolor="#ffffcc" topmargin="0" leftmargin="0" text="#660000">
<A HREF="index.htm"
onMouseOver="document.pic1.src='C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Home_On.gif'"
onMouseOut="document.pic1.src='C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Home_Off.gif'">
<IMG SRC="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Home_Off.gif" BORDER=0 NAME="pic1" width="32" height="32">
</A>
<A HREF="Directory.htm"
onMouseOver="document.pic2.src='C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Directory_On.gif'"
onMouseOut="document.pic2.src='C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Directory_Off.gif'">
<IMG SRC="C:\Documents and Settings\John\My Documents\My Webs\The Lowrys\images\Directory_Off.gif" BORDER=0 NAME="pic2" width="32" height="32">
</A>
</BODY>
</HTML>
khalidali63
04-05-2003, 11:12 AM
I don't think it could get simpler then this..
:D
http://68.145.35.86/skills/javascripts/SimpleImageSwap.html
Cheers
Khalid
Keone
04-05-2003, 12:23 PM
Thanks Khalid. Your link gave me more to think about. The use of arrays is new to me. I'm thinking I need to dig into some more books. I'm also thinking that my code is close, but perhaps has some syntax errors? I noticed you used / (forward slash) as opposed to the \ (back slash) that I used. Could it be tat simple?
khalidali63
04-05-2003, 12:37 PM
yes it can be,\ (backslash) is mostly windows based environment.
You should use forward slash unless you have something Win OS specific.
glad to be of help
Cheers
Khalid