Results 1 to 6 of 6

Thread: Default Image, Prompt and Titles for Thumbnails

  1. #1
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Default Image, Prompt and Titles for Thumbnails

    1) Script Title: Thumbnail Viewer II

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    3) Describe problem: Script is working fine but I would like to add 3 enhancements:

    a) A default image when the page loads - currently the loadarea is blank until the mouse hovers over a TN.

    b) An "idiot prompt" telling visitors to hover over a TN to make it work. I have done this just by putting some text in the load area but it would be nice if this message disappeared after the first mouseover. Or is there some other script that will display for a fixed period?

    c) I want a multi-line Title. I have done this by putting a <BR> in the Title field but the code shows up when the mouse is over the TN. Ideally only the first line should display with the TN.
    Last edited by sabreur; 11-26-2008 at 07:25 PM.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    @ b) You could have something like this, I'm really bad at JavaScript but this should be simple enough, add this in the head section:

    Code:
    <script type="text/javascript">
    function HidePrompt(id)
    {
    var instructions = document.getElementById(id)
    
    instructions.style.display = "none"
    
    }
    </script>
    Then you'd add this to the HTML:

    Code:
    <div id="prompt" style="display:block;">
    Your prompt here, to tell users what to do
    </div>
    
    <img src="image1.jpg" onmouseover="HidePrompt(prompt);"/>
    Hope this helps, this is probably a really long winded version of what I suppose is pretty simple and please feel free to put up a much shorter version of this ^^

    Edit: Also, please fix your link above - it doesn't work at the moment.

  3. The Following User Says Thank You to Schmoopy For This Useful Post:

    sabreur (11-26-2008)

  4. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, now whatever you put in the loadarea will be wiped out once the user starts activating the thumbnails. So put a default image in there if you like, and a caption below it telling folks to click on the thumbnails:

    Code:
    <div id="loadarea" style="width: 600px">
    <img src="my_default.jpg" alt=""><br>
    Click on The Thumbnails to See Larger Versions Here.
    </div>
    That should take care of a and b.

    For c, you are already half way home. If you give the thumbnail image a title, it will override the link title for the mouseover 'tool tip' of the thumbnail image, ex:

    Code:
    <a href="bulb.gif" rel="enlargeimage::mouseover" rev="loadarea" 
    title="My long title with<br>a line break"
    ><img alt="thumbnail image" 
    title="My short title" src="bulb_tbn.gif"></a>
    Last edited by jscheuer1; 11-26-2008 at 04:30 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    sabreur (11-26-2008)

  6. #4
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Schmoopy View Post
    @ b) You could have something like this, I'm really bad at JavaScript but this should be simple enough, add this in the head section:

    Edit: Also, please fix your link above - it doesn't work at the moment.
    Thanks for the help, but I am going to go with Jschuer1's suggestion as it looks simpler.

    I've fixed the link. (I should have tested it before I copied it, sorry!)

  7. #5
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    OK, now whatever you put in the loadarea will be wiped out once the user starts activating the thumbnails. So put a default image in there if you like, and a caption below it telling folks to click on the thumbnails:

    Snip...
    title="My short title" src="bulb_tbn.gif"></a>[/CODE]
    I might have stumbled on the your prompt idea but for the fact that I have the gallery in a table and put the prompt outside the loadarea DIV so it didn't get overwritten.


    What I wanted to do with the TN Title was to have it appear underneath the thumbnail.The ALT title is really superfluous in this case which, I guess is why it was left out.

    I have now done this by adding Title text after the viewer declaration.

    It is all going swimmingly, thanks.

    Next problem is to load all the data for the images (I've got over 100!) from an external file so I can update everything easily, any ideas?

  8. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you have PHP, asp, or another server side language available, that would be the way to go for that, as the thumbnails being present on the page with their links to the larger images is a convenient non-javascript fall back. In a case like that, clicking on the thumbnail will allow the user to see the larger image alone in the window, and the browser's back button would return them to the page of thumbs.

    Failing that, javascript could be used to construct a layout of thumbnails from an array, but that would leave non-javascript users with nothing to see or do as regards the gallery.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •