#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    18
    Rep Power
    0

    Unhappy Help! JavaScript Nightmare!


    I have spent four days on this little nightmare. Does anyone have suggestions for a JS newbie?

    The following URL

    http://www.huntartsweb.com/shared/untitled1.shtml

    has a script which activates a rollover. The buttons in the purple area swap images on rollover, and an image in the grey bar under it swaps out for white text.

    The problem is when the mouse is out of the button area why doesn't the text flip the blank image up as the MouseOut state?

    Please help if you can!

    Ryan
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    Toronto, Ontario, Canada
    Posts
    631
    Rep Power
    14
    You have two different sources. When the page loads, this is the source for your 'remote' image:
    infobarStatic.src = "../images/infobar_image.gif"

    Then in the javascript you have:
    infobarStatic.src = "/images/infobar_image.gif"

    Make sure your paths are right.
  4. #3
  5. No Profile Picture
    Mc-Chin
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    86
    Rep Power
    13
    Hi,

    The path could be part of the problem..

    anyway the function inact should be the following

    function inact(imgName, activeRemote) {
    {
    var staticRemote;
    staticRemote = "infobarStatic";

    if (document.images)
    document.images[imgName].src = eval(imgName + ".src");
    document.images[staticRemote].src = eval(staticRemote + ".src");
    }
    }


    the line
    document.images[activeRemote].src = eval(staticRemote + ".src");
    change to
    document.images[staticRemote].src = eval(staticRemote + ".src");

    coz the image object activeRemote doesn't exists thus the javascript error document.images[...] is null or not an object

    hope this helps..

    regards
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    18
    Rep Power
    0
    mcchin solved the case.

    thank you, thank you, thank you.

IMN logo majestic logo threadwatch logo seochat tools logo