PDA

View Full Version : Image Thumbnail Viewer II - Default Large Image on Page load



doriggidy
08-16-2012, 09:46 PM
1) Script Title: Image Thumbnail Viewer II

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

3) Describe problem:

Hello, I am trying to have the Image Thumbnail Viewer display a large image on the page load, without having to mouseover the smaller thumbnail. I have searched the forums and I know I can insert an image into the loadarea<div> as described in this thread:

http://www.dynamicdrive.com/forums/showthread.php?t=22969

But what I would like to do I'm pretty sure needsto be handled internally in the script. I have a page sort on my page that rearranges the thumbnails and so as a result I would like to grab the FIRST thumbnail in the array of thumbnails.

My rationale is:
Image Thumbnail Viewer has no knowledge of what I'm doing with the
thumbnails or the way I'm sorting them...but what it does know is:
On the page load event:
...it has to internally organize them and assign a thumb:largeimage correlation.

I want to hook into the process when that relationship is created and grab the first one of the set and then assign that image as my default Large Image.

The sort feature that I'm using works on the page refresh so I don't think it will break it.

I hope I've been clear. Thanks in Advance

jscheuer1
08-17-2012, 01:13 AM
I'm going to assume the script works on this sorted page. If so, this should work -

If your gallery is activated by mouse over add:


<script type="text/javascript">
jQuery(function($){
$('a[rel=enlargeimage]').eq(0).trigger('mouseover');
});
</script>

If it's activated on click, change 'mouseover' to 'click'.

Whichever, add that script after the script for Thumbnail Viewer II.

If Thumbnail Viewer II wasn't working on the sorted page before this, or if this solution isn't working for you, I'd need to see the live page in order to help further.

doriggidy
08-17-2012, 03:53 AM
Wow! That worked perfectly. Really smooth. Thank you so much.