Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image Fit to New Window

    I am having a challenge with an image being displayed in a new window. I have tried using target = "new window" and target = "_blank".

    While each produce a new window I can not get the image to fit the new window. I have white space to the right of the image.

    You assistance is appreciated.
    John

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Image Fit to New Window

    You want the image to fill 100% of the horizontal space available in the window? Try:

    [img]myfile.jpg[/img]

    The height should adjust proportionately. With screen shots or other pixel-precise subjects, the results might be unattractive. In those cases, it is better to fit the window to the image.

    Added: The above assumes that you are opening an HTML file rather than directly opening the image. Obviously if you directly open the image, the browser will choose the manner of display. If the user has set the image resize option (e.g., IE's or Firefox's Advanced options), he or she might get different results than those who have not.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    John

    Here is a javascript in addition to Jeff's idea...I have added this in a text file as I know that Lex would get VERY annoyed with me.....just follow the instructions he has added in the txt file to get it to work <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Jerry

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Image Fit to New Window

    I think we also will want the code of popup.htm that reads the query parameter and displays the image. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> Somewhat like the code in this post: Re: No right-click for photos loaded in frames.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    Very true dear sir <img src=/S/gent.gif border=0 alt=gent width=17 height=25>

    I may as well paste the whole link, I didn't <img src=/S/rtfm.gif border=0 alt=rtfm width=24 height=23> <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    http://www.sitepoint.com/article/resize-po...fit-images-size
    Jerry

  6. #6
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image Fit to New Window

    Jerry,

    I tried the code you included in the attachment and I am challenged as to how to include the path to the JPG file.

    An example path would be:

    "http://MyDomain.org/Gallery/images/Pic_1807.JPG"


    I'm not sure how to substitue the 'Image1.gif' with the path mentioned above.
    <!a href="java script:PopupPic('Image1.gif')">Image 1<!/a><!br>


    John

  7. #7
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    Hi John

    It is just the path to your image in the root folder


    <!a href="java script:PopupPic('Gallery/images/Pic_1807.JPG')">Image 1<!/a><!br>

    get rid of the ! marks as they have been put there by Lex so not to confuse the Lounge parser.....I'll recreate it on my website in a bit and you can copy it if you like....give me a bit and I will get back to you
    Jerry

  8. #8
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    Hi John

    It is now uploaded to my website at http://www.magicforest.co.uk/popup.htm

    Be warned, it is not absolutely perfect for IE 6 as it does not change the height correctly but in Firefox it works a dream, have a look at the code in my page and you will see the "route" to my images...good luck
    Jerry

  9. #9
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image Fit to New Window

    Jerry,

    Thanks for the example code. I am still having a challenge with the single quote mark and entering in my path to the JPG file. I am receiving an error on loading the page. Sometimes the simple things in life prevent us from going over the low hurdles.

    I looked at your web site and read about " Big Brother": because I was curious. Then I happened to come across "Little Brother". <img src=/S/sad.gif border=0 alt=sad width=15 height=15> endings to a good story.

    Will "Little Brother" every fly again? Sort of reminds me of the Phoenix rising from the ashes. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Regards,
    John

  10. #10
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    Currently building a little machine to keep my laptop cool and will be publishing that.....Little Brother needs a little work to get it going, I just need some strong flexible material to fit to the cam.... I am always whizzing around with other projects and had kind of forgotten about LB...maybe when I have done my laptop I should look at it again <img src=/S/grin.gif border=0 alt=grin width=15 height=15>


    Back to business...are you htm files in a root folder and your graphics in a seperate graphics folder
    Jerry

  11. #11
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image Fit to New Window

    I have the html and graphic files in the same folder. What I currently have is a thumbnail, click on the thumbnail and the graphic opens in a new window. Unfortunately the new window does not fit the graphic file ie too wide with white space to the right of the picture.

    Regards,
    John

  12. #12
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Image Fit to New Window

    John, I think it will. The minimum width you will get is 112 pixels. Just to test can you try it with a larger image.
    Jerry

  13. #13
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image Fit to New Window

    Jerry,

    I've just returned to the States and I am focusing on this once again. I'm still having an issue (somewhat confused ie newbie). I see that you are passing a portion of your website address to this line of code:

    Jezza Bear

    Where the PopupPic is going to the folder graphics and retrieving the gif file. Is it possible to retrieve a gif file from a local drive such as D:Hold.

    The passing of the partial website address is confusing me as well as the PopupPic('graphics/grrrjezza.gif')" ie [apostraphies between the braces]

    Regards,
    John

  14. #14
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Image Fit to New Window

    Whenever you refer to a file in a website you use a Relative Path. A full path like D:Holdetc will work while everything is on your computer, but once you upload the files to a webserver it will no longer be correct.

    So all the files you want to include in a website need to be placed inside the one folder (and subfolders) and referred to by relative paths. Then you can upload the lot to a webserver, and all the relative paths will still be correct.
    Regards
    John



  15. #15
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image Fit to New Window

    John,

    My previous attempts to utilize D:hold (the relative path) along with the apostrophies leave me out on a limb. How about an example using the relative path D:hold along with the PopupPic.

    As they say a picture is worth a thousand word and in my case thanks.

    John

Page 1 of 2 12 LastLast

Posting Permissions

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