View Full Version : Open in new window behavior

01-24-2007, 03:43 AM
It works beautifully, but now I have two questions.

How do I change the background color? It automatically defaults to white. I need to change it to black.

How do I make it so that the popup automatically defaults to the size of image.

<img src="images/eli 12.jpg" width="199" height="174" border="1" onClick="MM_openBrWindow('http://www.elibennett.com/images/eli 12.jpg','','width=720,height=480')"

That's what I have to work with.


01-26-2007, 11:19 PM
I'm still learning myself but I'm pretty sure putting the picture in web page and then pointing to the page itself would then allow you to change the background.

01-27-2007, 02:03 PM
Stainless is right, if you want to control background color you have to put the image in a html document, and popup the html document instead.

For resizing the image, have a look at some of the 3rd party extensions over at the Exchange at Adobe.com

01-27-2007, 05:57 PM
i like new challenges...

here you go...

Run this page..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function popup(img, page){
var path = "Images/";
var pageB = eval('"'+page+'"');
image_object=new Image()
var h = '"height='+image_object.height;
var w = 'width='+image_object.width+'"';
var winSize = h+','+w;
window.open(pageB, "newwin", eval(winSize));
//window.open("popup.html", "newwin", eval(winSize));
return true;
<p><a href="#" onclick="popup('southern.jpg', 'popup.html')">Link1</a></p>
<p><a href="#" onclick="popup('qotsa.jpg', 'popup2.html')">Link2</a></p>

in the main page code above look for this ...

<a href="#" onclick="popup('southern.jpg', 'popup.html')">

you need to change the 2 arguments of the popup() function to the image that will appear and the page that will popup

you need 2 html pages called popup.html & popup2.html for this to work. Thes pages contain your images.

also remember to set the page margins to 0 in the popups or you wont return the correct window size as this is being defined by the images.

i have zipped up all the files you need to test this..