HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 3rd, 2004, 10:46 PM
chester p. chester p. is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 chester p. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simple Navigational Rollover Link (Image Swap) Error- Help

Hi...

I created this simple code to display three images/links that when rolled over, swap to an alternate image, giving the illusion of changing colour. Very simple... It seems to work when tested in IExplorer, but other programs find errors in it such as:

(When the image 'Back' is rolled over)
Line 31: 'Images' is undefined
'back_page' is undefined
'next_page' is undefined

(When the image 'Home' is rolled over)
Line 33: 'Assignment' is undefined
'document.home_page' is null or not a homepage

(When the image 'Next' is rolled over)
Line 35: 'Images' is undefined
'Assignment' is undefined
'document.Next_Page' is null or not a homepage

Below is the code.

Any help would be much appreciated... Thankyou.

<code>

<HTML>
<HEAD>
<TITLE> Question_2SMP</TITLE>

<SCRIPT Language="JavaScript">

if(document.imagesSMP)

{
buttonBack= new Image
buttonHome= new Image
buttonNext= new Image

buttonBack.src="Back.gif"
buttonHome.src="Home.gif"
buttonNext.src="Next.gif"
buttonBack2.src="Back2.gif"
buttonHome2.src="Home2.gif"
buttoNext2.src="Next2.gif"



}

</SCRIPT>
</HEAD>


<BODY >
<P align="center">
<A href="back_page.htm" onMouseOver="(back_page.htm)"><img src="Images/Back.gif" alt="Back" name="Image1" width="98" height="23" border="0" onMouseOver="Images/Back2.gif" onMouseOut="document.write=next_page.src=buttonNext.src"></img></A>&nbsp;&nbsp;

<A href="home_page.htm" onMouseOver="(Assignment/home_page.htm)"><img src="Images/Home.gif" alt="Home" name="Image2" width="98" height="23" border="0" onMouseOut="document.home_page.src=buttonHome2.src" a.href="Assignment/home_page.htm"></img></a>&nbsp;&nbsp;

<A href="next_page.htm" onMouseOver="(Assignment/next_page.htm)"><img src="Images/Next.gif" alt="Next" name="Image3" width="98" height="23" border="0" onMouseOver="Images/Next2.gif" onMouseOut="document.Next_Page.src=buttonNext2.src"></img></a>

</P>

</BODY>
</HTML>

</code>

Reply With Quote
  #2  
Old September 6th, 2004, 04:29 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Hi

I think you've got a bit over-complex somewhere. This should work:
Code:
<HTML>
<HEAD>
<TITLE> Question_2SMP</TITLE>
<SCRIPT Language="JavaScript">
 buttonBack= new Image;
 buttonHome= new Image;
 buttonNext= new Image;
 buttonBack2= new Image;
 buttonHome2= new Image;
 buttonNext2= new Image;
 buttonBack.src="Back.gif"
 buttonHome.src="Home.gif"
 buttonNext.src="Next.gif"
 buttonBack2.src="Back2.gif"
 buttonHome2.src="Home2.gif"
 buttoNext2.src="Next2.gif"
</SCRIPT>
</HEAD>

<BODY >
<P align="center"> 
<A href="Back_page.htm" onMouseOver="Image1.src='Back2.gif';" onMouseOut="Image1.src='Back.gif';"><img src="Back.gif" alt="Back" name="Image1" border="0"></img></A>&nbsp;&nbsp;
<A href="Home_page.htm" onMouseOver="Image2.src='Home2.gif';" onMouseOut="Image2.src='Home.gif';"><img src="Home.gif" alt="Home" name="Image2" border="0"></img></a>&nbsp;&nbsp;
<A href="Next_page.htm" onMouseOver="Image3.src='Next2.gif';" onMouseOut="Image3.src='Next.gif';"><img src="Next.gif" alt="Next" name="Image3" border="0"></img></a> 
</P>
</BODY>
</HTML>
MK

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Simple Navigational Rollover Link (Image Swap) Error- Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway