SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    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

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 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

  3. #3
    SitePoint Member
    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];

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •