Results 1 to 3 of 3

Thread: DHTML Window - size depending on content

  1. #1
    Join Date
    Apr 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question DHTML Window - size depending on content

    1) Script Title: DHTML Window

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/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?

    Code:
    <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>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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?
    DD Admin

  3. #3
    Join Date
    Apr 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    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...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •