PDA

View Full Version : DHTML Window - size depending on content



rhiaro
12-14-2008, 11:20 PM
1) Script Title: DHTML Window

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

I'm using the script to load images inline, and it would be ideal if I could set the width and height of the window to match the dimensions of the images.

I changed width and height to auto - which seems to work perfectly for width, but not height. Any ideas?


<a href="gallery/phr06.jpg" onClick="img01=dhtmlwindow.open('img01', 'inline', '<a href=# onClick=img01.hide(); return false><img src=gallery/phr06.jpg /></a>', 'PHR Gallery', 'width=auto, height=auto, left=50px,top=50px,resize=1,scrolling=0'); return false"><img src="gallery/thumbs/phr06.jpg" class="imgpad2" /></a>

ddadmin
12-15-2008, 08:32 AM
Even for width, auto probably won't work correctly in some browsers. The bottom line for a consistent result is to pass in explicit values for the width/height attributes inside dhtmlwindow.open() based on the image's dimensions. I gather you actually want a way to not have to specify any explicit dimensions for the window?

rhiaro
12-15-2008, 10:38 AM
I gather you actually want a way to not have to specify any explicit dimensions for the window?

Yes.

And oh. The DHTML window doesn't work at all in IE; the link just opens in a new window. However, I have used that method to open a page inside the DHMTL window as well, and that one seems to be fine... Any ideas on that one as well..?

The test site is at www.cguy.co.uk/amy/PHR/container.htm - the Listen Online button opens a DHTML window fine, but the images in Gallery don't...