Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Thanked 0 Times in 0 Posts

    Image opens in IE6 but not in Netscape


    I have a table of thumbnails, when I click one I want it to open a named new window, with background colours and text and a full size version of the chosen image. Depending on how I do it, I get different results in IE6, Netscape and Opera.

    openproductwindow() is a javascript funtion which opens the window and writes the required text, 'filetoopen' is the variable carrying the name of the image to open in the new window.

    Method 1 - works in IE6, new window loads but the image is not found in NS or Opera.

    <td width="12%" align="center" valign="middle" class="product_table_background">
    <a> <img src="pictures/products/EB63900thumb.JPG" name='text1' value='pictures/products/EB63900.JPG' width="66" height="72" border="0"
    onMouseOver='javascript:filetoopen=(text1.value)' onClick=openproductwindow() alt="EB63900"></a></td>
    <td width="48%" align="center" class="product_table_background" height="67" valign="top">

    Method 2 - works in all 3 browsers, but I cannot get the image to align properly in the table, there's always an extra border underneath the thumbnail, which looks messy.

    <form name='myform1'>
    <input type='hidden' name='text1' value='EB63900.JPG'>
    <input type='image' src='EB63900thumb.JPG' onMouseOver='javascript:filetoopen=(text1.value)' onClick=openproductwindow() alt="eb63900">

    form name, text1 name and values change for each image.

    I want to use method 1, because of the alignment issue, and because I've already set the code up for lots of images!

    Can anyone tell me why method 1 doesn't work in NS and Opera, and how to get it to work?

    Thanks for any help,
    Dave P.

    After a good night's sleep, I managed to re-write the code so that it works in all 3 browsers, if anyone's remotely interested it now looks like this:

    <td width="11%" align="center" valign="middle" class="product_table_background">
    <a href="javascript:filetoopen='pictures/products/EB63900.JPG',openproductwindow()"><img src='pictures/products/EB63900S.JPG' width="66" height="72" border=0 alt="EB63900"></a></td>


    Dave P.
    Last edited by DaveP; 05-16-2004 at 12:38 PM. Reason: Found a fix myself


Posting Permissions

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