IE and mozilla auto resize pics

  waydekirrane 14:06 14 Sep 2004

i've just uploaded a picture to a website that pops up, using some javascript, when you click a link. the java enables me to stipulate the size of the window that opens to show the picture. is it possible to keep the picture at it's original size and scroll bars to appear on the pop up windon instead.

the script i'm using is:


function openpopup1(){
var popurl="picture1.gif","","width=000,height=000,resizable=1,location=0,left = 000,top = 000")


a href="javascript:openpopup1()">link to picture1 /a>

  Eric10 15:06 18 Sep 2004

This may not be the definitive answer but my way of doing this would be to make an html page that contains the picture. This will allow you to set the size that you want for the picture, centre the picture on the page and include a background colour and also text if required. You will then use a script to launch the new page instead of just the picture. I don't know enough about writing javascript to play about with your existing script (I did manage to put a scrollbar on the popup but couldn't stop the picture from resizing which made the scrollbar irelevant) but here is a script I use to launch new windows on my own site. As it stands this opens the new window in the top-left of the screen but this can be changed by altering the value of winl (left) and wint (top). The new window will not have menus or toolbars so will be very similar to the popup you now have.

<script language="JavaScript">

function newWindow(mypage, myname, w, h, scrol) {

var winl = 10;

var wint = 10;

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrol+',resizable=1';

win =, myname, winprops);

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }


usage: <a href="javascript:newWindow('picture1_page.htm', 'picture1',400, 400,'yes')">link to picture1</a>

Substitute "picture1_page.htm" with the name of your page containing the picture, "picture1" is a name for the new window and can be anything of your choice but if the same name is used again while the window is still open then the new page will load into the same window, while using a different name will open another window. Next come the width and height of the new window followed by a value of 'yes' or 'no' for scrollbars (1 or 0 will also work here).

The code for the picture page could be as simple as:




<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta http-equiv="imagetoolbar" content="no">



<p align="center"><img src="picture1.jpg"></p>

<p>Descriptive text for picture if required</p>



  waydekirrane 15:30 06 Dec 2004

i can't get it to work
i've changed the url of the new page i created and tried a title that matches the title tag of the new page. i even took out the ' at the end of:


as it didn't look right

still not getting a pop up. can you help pls

  dez fowler 20:40 06 Dec 2004
  Eric10 21:38 06 Dec 2004

click here for a working test page. Right-click on the page and view source for the code.

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

Elsewhere on IDG sites

Best Black Friday Deals 2017

How modern book design was influenced by illustrated manuscripts

Best Black Friday Apple Deals 2017

Les meilleurs logiciels de montage vidéo gratuits (en 2017)