Log in

View Full Version : Image Thumbnail Viewer Issue



john_t_03
04-06-2008, 05:36 PM
1) Script Title:
Image Thumbnail Viewer

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

3) Describe problem:
I'm using this script for a page with 20-30 thumbnails. Everything works, but the problem is that I have to wait till all the thumbnails are loaded on the page before this script works. Otherwise, when I click on the image, it just opens the linked image as if there is no script. Only after all the thumbnails are loaded is when the script begins working. Is this a known issue or am I doing something wrong? Is there a way to fix this?

Thanks.

ddadmin
04-06-2008, 07:58 PM
This is the designed behavior of the script, yes, to initialize itself after the page has fully loaded. You can get around that by removing the following line inside the .js file:


thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load") //Initialize script on page load

Then, at the bottom of your HTML page (ie: right above the </body> tag), add the below:


<script type="text/javascript">
thumbnailviewer.init()
</script>

john_t_03
04-06-2008, 09:38 PM
Thanks, this works. I still have to wait till the page loads, but at least it says "loading" and doesn't prematurely open an image. Great script, thanks.