PDA

View Full Version : Opening multiple resizable popups within same popup window


jacqstewart
10-04-2002, 10:22 AM
Hi

I'm using a dhtml menu and I want to use it to open a page in a popup window. The html pages I'm opening have photographs of different sizes so I need to resize each window when it opens, but obviously, rather than having multiple windows open, I'd like to have them open in the same popup window and it resize as necessary. It's using a window.open statement within the menu item and, although it lets me add focus(), it doesn't seem to let me use return false ; within the block of code shown below.


menu.subMenus[2].addItem("Statue of<br>Liberty","window.open('newyork6.htm','','menubar=0,resizable=yes,scrollbars=0,status=0,width=300,height=400',t itlebar=0,toolbar=0)");

menu.subMenus[2].addItem("Central<br>Park","window.open('newyork2.htm','','menubar=0,resizable=yes,scrollbars=0,status=0,width=300,height=470',t itlebar=0,toolbar=0)");




Any advice would be much appreciated!!

glenngv
10-04-2002, 10:39 AM
window.open('newyork6. htm','MyPopUp','menubar=0,resizable=yes,scrollbars=0,stat
us=0,width=300,height=400',titlebar=0,toolbar=0)

put same target names in all your window.open statements like above

jacqstewart
10-04-2002, 10:57 AM
Hi Glenn

Many thanks for your prompt response.

That extra bit of code certainly means that the pages are opening in the same popup window, but now they are not resizing. Each page opened stays the same size as the first popup window selected.

I'm stumped! :confused:

glenngv
10-04-2002, 11:01 AM
win = window.open('newyork6. htm','MyPopUp','menubar=0,resizable=yes,scrollbars=0,stat
us=0,width=300,height=400',titlebar=0,toolbar=0);
win.resizeTo(300,400)

jacqstewart
10-04-2002, 11:14 AM
Glenn,

You are an absolute STAR!!!

That did the trick nicely - many thanks for your help :D

waomaster
08-14-2003, 06:07 PM
I am trying to put together a script that would launch a popup window that would AUTOMATICALLY resize to the given image size.

This is different then the resize=yes attribute (there will be no dragging or scrolling allowed for these windows)

There will be many size images to be served (250x250 or 350x350 or 300x350 etc.). I am trying to figure out how to dynamically have the popup window expand or shring automatically to fit around the image size without having to state the size of the image.

Any suggestions would be great.

Thanks,
WapMaster

cheesebag
08-14-2003, 06:12 PM
Courtesy of beetle, typically excellent:

http://www.codingforums.com/showthread.php?threadid=9836&highlight=image+window

waomaster
08-14-2003, 07:13 PM
Thanks for the quick reply...I did a search before posting and didn't see this one listed. In any event...

I will be pulling images from a 3rd party in which they will be returning:

var win=window.open('javascript:"<HEAD><TITLE>&nbsp;</TITLE></HEAD><BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0><a href=http://img.randomimage.com/clickdestination/randomnum='+randomnum+' " target=_blank><img src=http://img.randomimage.com/pix001.gif border=0 alt=\'Click to see picture\'><\/a></BODY>"',"'+randomnum+'","width=720,height=300,status=0,location=0");

So they will be dynamicall sending the different sized images each time.

I am having trouble pulling these into this script. Any advise?

Thanks again !