Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-15-2004, 01:04 PM   PM User | #1
DaveP
New to the CF scene

 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
DaveP is an unknown quantity at this point
Image opens in IE6 but not in Netscape

Hi,

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>

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,
Regards,
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>

Regards,

Dave P.

Last edited by DaveP; 05-16-2004 at 11:38 AM.. Reason: Found a fix myself
DaveP is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:02 PM.


Advertisement
Log in to turn off these ads.