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

    Join Date
    Nov 2000
    Posts
    6
    Rep Power
    0
    Ok i want an image to swap when i do a rollover; I get eh rollover but no image swap. heres my code can some please tell me what im doing wrong or what im missing; Im not pulling an error so its really making me NUTS!!




    <script language="javascript">
    function activate_multi(imgName) {
    document[imgName].src = eval(imgName+ "on.src");
    document["garcia_lives"].src = eval(imgName + "garcia_lives.src");
    }

    function deactivate_multi(imgName) {
    document[imgName].src = eval(imgName+ "off.src");
    document["garcia_lives"].src = "/peopleparties/polls/RCW/images/preroll_highlight.gif";
    }


    afirston = new Image();
    afirstoff = new Image();
    afirstgarcia_lives = new Image();
    afirston.src = "/peopleparties/polls/RCW/images/julia1_roll.jpg";
    afirstoff.src = "/peopleparties/polls/RCW/images/julia1_off.jpg";
    afirstgarcia_lives.src = "/peopleparties/polls/RCW/images/julia_valentino.jpg";

    asecondon = new Image();
    asecondoff = new Image();
    asecondgarcia_lives = new Image();
    asecondon.src = "/peopleparties/polls/RCW/images/julia2_roll.jpg";
    asecondoff.src = "/peopleparties/polls/RCW/images/julia2_off.jpg";
    asecondgarcia_lives.src = "/peopleparties/polls/RCW/images/julia_blass.jpg";

    athirdon = new Image();
    athirdoff = new Image();
    athirdgarcia_lives = new Image();
    athirdon.src = "/peopleparties/polls/RCW/images/julia3_roll.jpg";
    athirdoff.src = "/peopleparties/polls/RCW/images/julia3_off.jpg";
    athirdgarcia_lives.src = "/peopleparties/polls/RCW/images/julia_kors.jpg";

    afourthon = new Image();
    afourthoff = new Image();
    afourthgarcia_lives = new Image();
    afourthon.src = "/peopleparties/polls/RCW/images/julia4_roll.jpg";
    afourthoff.src = "/peopleparties/polls/RCW/images/julia4_off.jpg";
    afourthgarcia_lives.src = "/peopleparties/polls/RCW/images/julia_laurent.jpg";


    //-->
    </SCRIPT>

    <body bgcolor="#999999" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top"><img name="garcia_lives" src="/homepage/images/preroll_highlight.gif" width="100" height="175" border="0"></td>
    <td><img src="/globalimages/spacer.gif" height="10" width="3" border="0"></td>
    <td valign="top" >
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><a href="#" target="_parent" onMouseOver="activate_multi('afirst')" onMouseOut="deactivate_multi('afirst')"><img name="afirst" src="/peopleparties/polls/RCW/images/julia1_off.jpg" width="55" height="87" border="0"></a></td>
    <td><img src="/globalimages/spacer.gif" height="10" width="3" border="0"></td>
    <td><a href="#" target="_parent" onMouseOver="activate_multi('asecond')" onMouseOut="deactivate_multi('asecond')"><img name="asecond" src="/peopleparties/polls/RCW/images/julia2_off.jpg" width="55" height="87" border="0"></a></td>
    </tr>
    <tr>
    <td colspan="3"><img src="/globalimages/spacer.gif" height="3" width="10" border="0"></td>
    </tr>
    <tr>
    <td><a href="#" target="_parent" onMouseOver="activate_multi('athird')" onMouseOut="deactivate_multi('athird')"><img name="athird" src="/peopleparties/polls/RCW/images/julia3_off.jpg" width="55" height="87" border="0"></a></td>
    <td><img src="/globalimages/spacer.gif" height="10" width="3" border="0"></td>
    <td><a href="#" target="_parent" onMouseOver="activate_multi('afourth')" onMouseOut="deactivate_multi('afourth')"><img name="afourth" src="/peopleparties/polls/RCW/images/julia4_off.jpg" width="55" height="87" border="0"></a></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
  2. #2
  3. T-Shirt Tragic
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    886
    Rep Power
    321
    what happens if you remove the leading forward slash from your pathnames?

    for example the pathname:-
    "/peopleparties/polls/RCW/images/preroll_highlight.gif"

    perhaps should read as:-
    "peopleparties/polls/RCW/images/preroll_highlight.gif"
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    63
    Rep Power
    14
    Your code seems more complicated than it should be.
    Goto this site http://www.wsabstract.com/script/scr...ifferent.shtml

    - hopefully that will help you.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    6
    Rep Power
    0

    thanks


    of course one of the main reasons i couldnt figure this out was b/c i was being interrupted EVERY 2 seconds . I figured it out once everyone left and i got a moment to actually LOOK at the code; In a nutshell I kept using the same call for the function to perform for every set of images; once i created seperate id's to call the rollovers then every thing was chedder =). thanks for the assists offered!

IMN logo majestic logo threadwatch logo seochat tools logo