Javascript Popup Images

  Blampish Man 12:43 04 May 04
Locked

I'm new to using Javascript, and can understand the basics, but am having trouble with some images. I basically have thumbnail images on my page, and I got some Javascript to make popup windows with the full size images in, but the code I have only lets me set the size once, so for all of the images on the page the popup window is the same size.

This is the script I got:

SCRIPT language="JavaScript" type="text/javascript">
!-- ;
var newwindow = '
function popitup(url) {
{
newwindow=window.open(url,'htmlname','width=330,height=480');}
}
/SCRIPT>

and then this part:

a href="javascript:popitup(image1.jpg')"> img src=image1_t.jpg> /a>

So instead of setting the size I would like to specify the size for each image myself, but when I've tried this it doesn't work.

Can someone help me please.

  rwarrender 07:43 05 May 04

<SCRIPT language="JavaScript" type="text/javascript">
<!-- ;
function popitup(url,picw,pich) { { newwindow=window.open(url,'htmlname','width='+picw+',height='+pich);} }
</SCRIPT>

and then this part:

a href="javascript:popitup('image1.jpg',300,400)"> img src=image1_t.jpg> /a>


I think this should work now so you can resize it. It is annoying that the forums mess up the code :( but email me if you have anymore trouble.

From Richard

This thread is now locked and can not be replied to.

Hands-on: Acer Predator Triton 700 review

D&AD Awards 2017: see the best design, advertising, illustration, animation and VR of the past year

How to lose weight with an Apple Watch