Results 1 to 3 of 3

Thread: Thumbnailviewer II: Preload image in loadarea

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thumbnailviewer II: Preload image in loadarea

    1) Script Title: Thumbnail Viewer II

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

    3) Describe problem:

    Thanks for sharing this script! I have a question how to preload an image in the load area once opening the page.
    I have 2 images, displayed as thumbs and the load area below, but when opening the page I have to move the mouse over the thumbs to get an image in the load area. I sure been searching and testing different things but no result so far.

    As I understand the image doesn't get cached until mouseover=true perhaps this could be done with the help of onload or onpage or whatever.But this is a declarion in the js file I think,

    My code below:

    PHP Code:
    echo "<a href=\"{$row1['bildpath']}\" rel=\"enlargeimage::mouseover\" rev=\"loadarea\"><img src=\"{$row1['bildpath']}\" width=\"$width\" height=\"$height\"</a>";

    echo 
    "<a href=\"{$row2['bildpath']}\" rel=\"enlargeimage::mouseover\" rev=\"loadarea\"><img src=\"{$row2['bildpath']}\" width=\"$width\" height=\"$height\"</a><br />";
        
    echo 
    "<div id=\"loadarea\" style=\"width: 400px\" </div>"
    Very, very greatful for any help.

    Regards,
    Morgan

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Actually the easiest way is just to manually add an IMG tag inside the load area DIV that shows the image you want when the page loads, for example:

    Code:
    <div id="loadarea" style="width: 600px"><img src="photo1.jpg" /></div>
    DD Admin

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

    Fynd (03-28-2010)

  4. #3
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that! It worked. Next issue, I have different sizes of the images, I don't want to distort them and therefor only scale them down, keeping the aspect ratio. Using the a href tag doesn't allow the height and width tag. Any suggestion?

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
  •