LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2011, 01:10 PM   #1
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
javascript rollover issue


this should have been a simple task, but for some reason one of my rollovers plain old isn't working

my html sheet
Code:
<div style="background:#F5F5E9 url('/sites/all/themes/flossmoore1/images/bricks250.png');padding:1px;padding-top:5px;width:950px;border:0px solid #000000;height:159px;">
	<div>
		<div style="float:right;margin-right:1px;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front1.src=front1_2.src" onmouseout="document.front1.src=front1_1.src"><img name="front1" src="/sites/all/themes/flossmoore1/images/library.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="float:right;margin-right:1px;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front2.src=front2_2.src" onmouseout="document.front2.src=front2_1.src"><img name="front2" src="/sites/all/themes/flossmoore1/images/teachers_ina.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="float:right;margin-right:1px;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front3.src=front3_2.src" onmouseout="document.front3.src=front3_1.src"><img name="front3" src="/sites/all/themes/flossmoore1/images/parents_ina.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="float:right;margin-right:1px;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front4.src=front4_2.src" onmouseout="document.front4.src=front4_1.src"><img name="front4" src="/sites/all/themes/flossmoore1/images/student_ina.png" alt="button" width="75" height="75" /></a>
		</div>
<div style="float:right;margin-right:1px;height:76px;width:576px;border:0px solid #000000;">
			
		</div>
	<div>
		<div style="margin-top:1px;float:right;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front5.src=front5_2.src" onmouseout="document.front5.src=front5_1.src"><img name="front5" src="/sites/all/themes/flossmoore1/images/pictures_ina.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="margin-right:1px;margin-top:1px;float:right;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front6.src=front6_2.src" onmouseout="document.front6.src=front6_1.src"><img name="front6" src="/sites/all/themes/flossmoore1/images/blank_ina.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="margin-right:1px;margin-top:1px;float:right;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front7.src=front7_2.src" onmouseout="document.front7.src=front7_1.src"><img name="front7" src="/sites/all/themes/flossmoore1/images/blank_ina.png" alt="button" width="75" height="75" /></a>
		</div>
		<div style="margin-right:1px;margin-top:1px;float:right;height:76px;width:76px;border:0px solid #000000;">
			<a href="<front>" onmouseover="document.front8.src=front8_2.src" onmouseout="document.front8.src=front8_1.src"><img name="front8" src="/sites/all/themes/flossmoore1/images/blank_ina.png" alt="button" width="75" height="75" /></a>
		</div>

	</div>
</div>
my javascript code
Code:
if (document.images) {
     front1_1 = new Image
     front1_2 = new Image

     front1_1.src = '/sites/all/themes/flossmoore1/images/library.png'
     front1_2.src = '/sites/all/themes/flossmoore1/images/teachers_act.png'

     front2_1 = new Image
     front2_2 = new Image

     front2_1.src = '/sites/all/themes/flossmoore1/images/teachers_ina.png'
     front2_2.src = '/sites/all/themes/flossmoore1/images/teachers_act.png'
     
     front3_1 = new Image
     front3_2 = new Image

     front3_1.src = '/sites/all/themes/flossmoore1/images/parents_ina.png'
     front3_2.src = '/sites/all/themes/flossmoore1/images/parents_act.png'
     
     front4_1 = new Image
     front4_2 = new Image

     front4_1.src = '/sites/all/themes/flossmoore1/images/student_ina.png'
     front4_2.src = '/sites/all/themes/flossmoore1/images/student_act.png'
     
     front5_1 = new Image
     front5_2 = new Image

     front5_1.src = '/sites/all/themes/flossmoore1/images/pictures_ina.png'
     front5_2.src = '/sites/all/themes/flossmoore1/images/pictures_act.png'
     
     front6_1 = new Image
     front6_2 = new Image

     front6_1.src = '/sites/all/themes/flossmoore1/images/blank_ina.png'
     front6_2.src = '/sites/all/themes/flossmoore1/images/blank_act.png'
     
     front7_1 = new Image
     front7_2 = new Image

     front7_1.src = '/sites/all/themes/flossmoore1/images/blank_ina.png'
     front7_2.src = '/sites/all/themes/flossmoore1/images/blank_act.png'
     
     front8_1 = new Image
     front8_2 = new Image

     front8_1.src = '/sites/all/themes/flossmoore1/images/blank_ina.png'
     front8_2.src = '/sites/all/themes/flossmoore1/images/blank_act.png'
}
all but the one identified as front1 works, even though it's code is essentially identical to the rest

any ideas?

and yes i do have the javascript include on the page (it's a php template so that's elsewhere in the code, i just included the relevant html portion)

to be more specific it's the first one on the page (library.png)
the href="<front>" is just a dummy link until the rest of the pages they are supposed to link to are built

Last edited by frieza; 06-06-2011 at 01:13 PM.
 
Old 06-06-2011, 01:25 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Original Poster
Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
nvm, i figured it out, someone had put another image elsewhere on the page with the same name... fixed
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Javascript / PAC file issue dnoy Programming 1 03-25-2011 12:05 PM
mouse cursor edge rollover effect exodist Linux - Software 3 09-22-2008 12:28 AM
Javascript show/hide container issue jettachamp26 Programming 9 04-15-2008 03:22 PM
Rollover to db9 rkemp Linux - Networking 0 12-20-2004 12:43 AM
JavaScript ... Slow Display Issue TotalNoob Linux - General 3 08-15-2003 05:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration