View Single Post
Old 10-20-2004, 12:49 PM   #1 (permalink)
trogette
Registered User
 
Join Date: Oct 2004
Location: UK
Posts: 11
trogette is on a distinguished road
Send a message via AIM to trogette
still plodding away with pop-ups...

a few questions about this:

<head>
<title>product</title>
<script language="javascript"><!--
function popupWindow(url){ window.open(url,'popupWindow','toolbar=no,location =no,directories=no,dependent=yes,status=no,menubar =no,scrollbars=no,resizable=no,copyhistory=no,scre enX=150,screenY=150,top=150,left=150')}
//--></script>
</head>
<body>
<table>
<tr>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<td align="right">
<table style="font-size: x-small">
<tr>
<td valign="top"><img src="http://www.babyarmadillo.com/thumbnails/babyidea.jpg" width=100 alt="babyidea"></td>
</tr>
<tr>
<td align="center" valign="middle" >
<a href="javascript:popupWindow('http://www.babyarmadillo.com/images/cuddle.jpg')" ><img src="http://www.babyarmadillo.com/thumbnails/cuddle.jpg" width=100 alt="snug as bugs"><br>click to enlarge</a></td>
</tr>
<tr>
<td align="center" valign="bottom" >
<a href="javascript:popupWindow('http://www.babyarmadillo.com/images/mountains_back_backview3.jpg')" ><img src="http://www.babyarmadillo.com/thumbnails/mountains_back_backview3.jpg" width=100 alt="aiska from the back"><br>click to enlarge</a></td>
</tr>
</table>
</tr>
</table>
</td>
</tr>
<\td>
</table>
</table>
</body>

no1: where does the </td> come from at the top of the page??

no2: why doesn't the 'dependent' attribute work? It's supposed to close the pop-up when I browse away or close the window, isn't it? I know I can do an 'onUnclick' doofer but surely this should work?

no3: I've been comparing my code above to the following from the php stuff I mentioned before:

<head>
<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location =no,directories=no,status=no,menubar=no,scrollbars =no,resizable=yes,copyhistory=no,width=100,height= 100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
</head>
<body>
<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
</body>

When the image is clicked on and the pop-up appears (from the above database) the pop-up window is quite small, and resizes to the size of the image. Is that because of the document.write statement? It's a neat trick that I'd like to copy!

Thanks
Tracy
trogette is offline   Reply With Quote