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

    Join Date
    Sep 2000
    Location
    USA
    Posts
    226
    Rep Power
    14

    Javascript with div tag in Netscape


    I am having a problem getting my javascript to work inside a div tag in Netscape 4.0.

    I have a layer that appears when a user clicks a link. The layer has 4 thumb nail pictures above a large picture. The user can click on the thumbnails to see a larger version below. In IE, my code works. In Netscape, my code does not work. Thanks for any help. This is very frustrating.

    Javascript Code: (see div code below)

    <script language="javascript">
    <!--
    function SwapPic(num)
    {
    if (num == 1){document.large2.src="../../images/irp/recos/champion/corporate/details1_big.jpg"}
    else if (num == 2){document.large2.src="../../images/irp/recos/champion/corporate/details2_big.jpg"}
    else if (num == 3){document.large2.src="../../images/irp/recos/champion/corporate/details3_big.jpg"}
    else if (num == 4){document.large2.src="../../images/irp/recos/champion/corporate/details4_big.jpg"}
    }
    //-->
    </script>

    Div Code:

    <div id="div1" style="position:absolute; visibility:hidden; top:439; left:160;">
    <table width="400" cellspacing="0" cellpadding="0" border="0">
    <tr>
    <td><a href="javascript:SwapPic(1)"><img src="../../images/irp/recos/champion/corporate/details5_small.jpg" width="96" height="66" alt="" border="1" /></a></td>
    <td><a href="javascript:SwapPic(2)"><img src="../../images/irp/recos/champion/corporate/details6_small.jpg" width="96" height="66" alt="" border="1" /></a></td>
    <td><a href="javascript:SwapPic(3)"><img src="../../images/irp/recos/champion/corporate/details7_small.jpg" width="96" height="66" alt="" border="1" /></a></td>
    <td><a href="javascript:SwapPic(4)"><img src="../../images/irp/recos/champion/corporate/details8_small.jpg" width="96" height="66" alt="" border="1" /></a></td>
    </tr>
    </table>
    <img src="../../images/irp/recos/champion/corporate/whitefill.gif" width="1" height="5" alt="" border="0" /><br>
    <img src="../../images/irp/recos/champion/corporate/details5_big.jpg" name="large2" width="398" height="300" alt="" border="0" /></div>
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Gee, this has a familiar ring to it...

    If <img name="large2" ...> is inside "div1", you have to reference it as mentioned earlier, as a property of

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.div1.document(.large2)

    adios
    Last edited by adios; October 15th, 2001 at 08:44 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    USA
    Posts
    226
    Rep Power
    14
    Unfortunately, that is not working. Any insight as to why it isn't working?

IMN logo majestic logo threadwatch logo seochat tools logo