SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Jan 25, 2008, 20:39 #1
- Join Date
- Jan 2008
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can't Figure Out Roll-Over JAVASCRIPT - HELP!!!
Hey Guys,
Having a hard time figuring out why this roll-over java script isn't working. Any help would be appreciated.
http://www.bumperbully.com/products_...tion_test.html
Notice the top roll-over java script is functioning properly. However, the roll-over java script with the red car is not functioning properly.
How do I fix this? Please keep your explanation simple.
Thanks,
Eric
-
Jan 26, 2008, 04:30 #2
- Join Date
- Jan 2007
- Location
- Christchurch, New Zealand
- Posts
- 14,729
- Mentioned
- 104 Post(s)
- Tagged
- 4 Thread(s)
The rollover for the red car occurs, but it occurs in the first car area.
Currently you have only the one loadImg() function.
You need a second function, loadImg2() to load the red car.Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
-
Jan 26, 2008, 09:02 #3
- Join Date
- Jan 2008
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Still Not Working :(
Thanks For All The Help,
I added the second function for loadImg2(img){ - but the problem is still there. What am I missing?
http://www.bumperbully.com/products_...tion_test.html
function loadImg(img){
var imgName = "big1"; // name of the big image
var srcs = ["/images/bumper_bully_1.jpg","/images/roll_over_impact_1.jpg","/images/roll_over_impact_2.jpg","/images/bumper_bully_impact_absorber.jpg","images/bumper_bully_w_impact_absorber.jpg", "/images/roll_over_bumper_bully_2.jpg", "/images/roll_over_bumper_bully_3.jpg"]; // array of SRC's for the big images
document.images[imgName].src=srcs[img];
}
function loadImg2(img){
var imgName = "big2"; // name of the big image
var srcs = ["/images/bumper_bully_1.jpg","/images/roll_over_impact_1.jpg","/images/roll_over_impact_2.jpg","/images/bumper_bully_impact_absorber.jpg","images/bumper_bully_w_impact_absorber.jpg", "/images/roll_over_bumper_bully_2.jpg", "/images/roll_over_bumper_bully_3.jpg"]; // array of SRC's for the big images
document.images[imgName].src=srcs[img];
-
Jan 26, 2008, 14:16 #4
- Join Date
- Jan 2007
- Location
- Christchurch, New Zealand
- Posts
- 14,729
- Mentioned
- 104 Post(s)
- Tagged
- 4 Thread(s)
It looks to me to be working fine now, both in Firefox and IE.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
Bookmarks