SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Rotterdam
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Open new window for image

    Hello,

    Does some1 knows how to place an image from begin of windows. My image starts not from left=0 and top=0 but like left=10 and top=10
    Look here


    My code what i have typed is:
    Code:
    <a href=\"#\" onclick=\"javascript:window.open('$IMAGE_DIR/{$prow['photo_id']}.jpg','image','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=$WIDTH,height=$HEIGHT,left=0,top=0')\">
    What do i need to change to get it from 0 and not from 10?

    thx,
    miggy

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if memory serves me right the top - left locations in a pop up are relative to the launching window ... not including the frame around the browser.

    Never tried it but did you try negative values for them?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Rotterdam
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no, never tried. never heard of it btw :S
    if you mean to make left=-10 and top=-10 then yes but it didnt worked...

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never tried it but did you try negative values for them?
    In IE, the values for 'top' and 'left' have to be greater than or equal to 0, so that won't work. I don't know of a way to open an image directly in a popup and control the margins. In addition, the minimum height and width of the popup is 100 x 100, so if your image is smaller than that, you are out of luck.

    One solution would be to open an html page instead of an image(which I don't think window.open() was designed for). On the page, you can have an <img> tag with your image as the src, and then you can eliminate the default margins and padding. See here:

    http://www.sitepoint.com/forums/show...40&postcount=7

    That will take care of the left and top margin. You would also need to set the 'height' and 'width' of the popup to the same size as your image to take care of the right and bottom margins.

    You can use the same html page for all your images--instead of creating one for each image--by using the window.onload event to change the src of the <img> tag to the desired image.
    Last edited by 7stud; Jan 17, 2005 at 02:12.

  5. #5
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why use a standard popup?

    http://homepage.ntlworld.com/vwphill...ImagePopUp.htm

    I think this will give you all the control you need


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
  •