Results 1 to 9 of 9
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbnails with image links

    I am trying to make a CD with pictures from a funeral of a friend and many of the potential users are NOT very computer literate. I need this to be as simple and hassle-free as absolutely possible.

    My desire is to create a disk that when inserted opens with an html page displaying thumbnails to all the pictures. I can do all the technical AutoRun.ini stuff, and I can create a thumbnail html page easily using IrfanView. I have ONE problem...
    _______________

    When I double-click an image, this causes my default image viewing program to open the file. Additionally, this triggers the annoying "File Download" message box (see image). Ideally, I do NOT want that File Download message box to appear and I would prefer that IE itself just opens the pictures in the parent window.

    Here is the code the IrfanView create for the image and the link:
    _________________

    <TD ALIGN=CENTER VALIGN=BOTTOM><FONT face="Verdana, Arial, Helvetica, Sans-Serif" size="-2"><A HREF="file://C:WINDOWSDesktopFuneralPicturesIMG_0013.JPG" target="ImageWindow">
    [img]IMG_0013.JPG_t.jpg[/img]IMG_0013.JPG1016.74 KB</A></FONT></TD>
    _________________

    If I eliminate the target="ImageWindow" part, this does surprisingly little -- everything works the same. Additionally, if I remove the "file" protocol prefix, this also does surprisingly little -- it still works the same!

    Is there a way I can force the html file to have IE open the pictures in the parent window (regardless of my .jpg file association) AND avoid that message box (without having to disable it globally for .jpg files). Even if I modify this setting on my computer, unless I distribute the CD with a VBScript file that modifies other people's .jpg download settings, they will still be harassed by this box.

    How do I need to modify the HTML so that IE will open the image directly without displaying the box -- on any and every computer??

    Thanks.
    Attached Images Attached Images

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Thumbnails with image links

    I figured out a couple of things:

    1) If I change "file:" to "http://", that makes IE open the image files.

    2) If I delete the target line altogether, then the parent window opens the image.

    3) If I use target=_blank, then a new window opens with each new picture -- soon you have too many IE windows open!

    4) Using target="ImageWindows" create ONE new window and reuses it. Probably the best idea.
    _____________________

    But... I still cannot figure out how to get "relative indexing" -- I don't remember this. I want the .html file to exist in the same folder as the images (.jpg's). But... if I simply use http://IMG0013.jpg, I get a "File not Found" error page.

    How can I make the indexing relative so I don't have to state a drive and folder? Try as I may, I cannot get it to work. Isn't they a way to get the "A HREF" achors to use relative references??

    Thanks.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Thumbnails with image links

    Leave off the http:// from the reference:

    < a href="img0013.jpg">Your text here< /a> (spaces left for lounge display purposes)

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Thumbnails with image links

    That is what I tried at first -- but there is ONE problem... If the user does not use IE as the default .jpg viewer (something that is quite frequent), then whenever (s)he clicks a thumbnail the annoying File Download Warning box appears! Having to hit the "Open" button each time to view an image quickly becomes very tiresome...

    I think the only answer is to use JavaScript....
    Attached Images Attached Images

  5. #5
    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: Thumbnails with image links

    If the answer is JavaScript, try this:
    <pre><html>
    <head>
    <title>Event Name, Event Date</title>
    <script>
    function UpdateIMG(strFileName)
    {
    //IE5+ and NS6+
    var myIMG = document.getElementById("Photo");
    myIMG.src = strFileName
    }
    </script>
    <style>
    body, p, td, li {font-family: arial;
    color: white;
    font-size: 10pt}
    h3 {font-family: arial;
    color: white;
    font-size: 14pt}
    </style>
    </head>
    <body bgcolor="black" link="#FFFF00" vlink="#C0C0C0" alink="red">
    <table width="100%">
    <tr>
    <td valign="top">
    <h3>Event Title
    Event Date</h3>
    1. Caption for Photo 1
    2. Caption for Photo 2
    3. Caption for Photo 3
    4. Caption for Photo 4
    5. Caption for Photo 5

    </td>
    <td valign="top">
    [img]Img_0001.jpg[/img]
    </td>
    </tr>
    </table>
    </body>
    </html></pre>

    It works best with shorter captions, a maximized browser window, and modestly sized images.

    If you need a solution that works with IE4, search for an older thread here where I was puzzling over how NOT to use IE4's proprietary object model. I think there was a function named something like "sniffbrow" involved. Maybe that will help with the search.

  6. #6
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Thumbnails with image links

    R2, if you've already got the Autorun stuff and all, maybe you might want to take a quick look here: http://www.alhoffman.org/baby/album9.html and view the source code for the script. It sure ain't elegant but it is relative and takes only a single click on a thumb.

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Thumbnails with image links

    Thanks. How would you like a box full of Thomas the Tank Engine train stuff that my kids don't use any more? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    I got it working finally. There was simply a problem with my set up. To make a long story short, something I had done previously was causing the Download Warnings -- the average user will never see them.

    Your basic script code is:

    <script LANGUAGE="Javascript">

    function showwin(name,size)
    {
    attrbts = size + ",resizable=yes,toolbar=no,location=no,directories =no,status=no,menubar=no,scrollbars=yes"
    window.open(name, "Photos", attrbts);
    }

    </script>

    The "size" refers to the border, correct? Since all borders are the same, couldn't you declare the size in the SCRIPT section? (Warning: poster is very ignorant of scripting and coding).

    Also, can I "declare" the script section in the body or the head -- and does it matter? Thanks.

    Jeff, I still want to play with your script and see what I can do with it. Thanks.

  8. #8
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Thumbnails with image links

    <hr>...Warning: poster is very ignorant of scripting and coding...<hr>
    Me Too! Someone gave me the script a couple of years ago and I know very little about coding, but I do think it needs to be in the body, not the head. Also, if I'm not mistaken, the SIZE attribute allows you to display the larger pix in whatever size you specify. Since many of my shots are different sizes, all my entries make use of that parameter (look further down in the page code). You'll also note from my code that I keep the thumbs in a directory under the primary (called "small") but if you give 'em different names, there's no reason why all photos can't be in the same directory. I'm glad you're making progress!

  9. #9
    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: Thumbnails with image links

    > The "size" refers to the border, correct?
    Since it can vary with each photo, I would think it's related somehow to the pixel dimensions of the photo, but that's just a guess.

    > Also, can I "declare" the script section in the body or the head -- and does it matter? Thanks.
    With modern browsers, no. (Browsers that predate the <script> tag will just display the contents of the script, so the head section is better for those, I think.)

    > Jeff, I still want to play with your script and see what I can do with it. Thanks.
    It's easy and fun. Except for the part while I was still writing it. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Update: After I posted, my browser redisplayed your original post, and I saw you wanted thumbnails. Although you could substitute thumbnail for captions in my page, and rearrange the two table cells into separate rows for better effect, I think you might find the overall effect a bit cramped.

Posting Permissions

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