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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…