SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast iveka's Avatar
    Join Date
    May 2002
    Location
    Winchester, VA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Window size for a photo pop-up

    How do I get the window that my pictures pop up in to be the same size as the photo. As it is now, they open up and have a lot of white space around them.

    For example, I have a thumbnail that links directly to the .jpg file that is full size. I have it linked with it's target window as _blank (in Dreamweaver). How do I make it the same size as the actual picture?

    Thanks


    ----- Jeremy -----

  2. #2
    SitePoint Evangelist pip's Avatar
    Join Date
    Jun 2001
    Location
    Cape Town, South Africa
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might have to add some javascript functionality to get this done. Possibly try the following code.

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    function openThumb(imgSrc,imgWidth,imgHeight) {
      var thumbBox = window.open(imgSrc,"ThumbNail","toolbar=0,menubar=0,status=0,scrolling=0,width=" + imgWidth + ",height=" + imgHeight);
      return;
      thumbBox.focus();
    }
    
    </SCRIPT>
    
    <A HREF="JavaScript: openThumb('myimg.jpg',200,300);">Show Thumbnail</A>
    You might have to add extra spacing for a width and height, since the document margins contains spacing.
    - Pip
    ---------------------------------------------------------------------------------
    Nothing takes the taste out of peanut butter quite like unrequited love.


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
  •