Results 1 to 5 of 5

Thread: Image Thumbnail Viewer & onclick method

  1. #1
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image Thumbnail Viewer & onclick method

    1) Script Title:
    Image Thumbnail Viewer
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm
    3) Describe problem:
    Hi,

    I would like to use the onClick method instead of rel="thumbnail".
    Is it possible? If 'yes' how?

    I'm doing a dynamic image gallery using ajax, all images will load from many differents websites.

    Thanks a lot.

  2. #2
    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

    The basic onclick would be:

    Code:
    onclick="thumbnailviewer.stopanimation();thumbnailviewer.loadimage(this);return false;"
    You may or may not need more than that. If these are being loaded after the initialization of the page, it probably wouldn't hurt to still give the tag the rel attribute.
    Last edited by jscheuer1; 07-26-2007 at 05:05 AM.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John, works great, just last question: why we need 'stopanimation' func? to stop/clear previous loaded image?

  4. #4
    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

    Quote Originally Posted by 01eg View Post
    Thanks John, works great, just last question: why we need 'stopanimation' func? to stop/clear previous loaded image?
    Yes, at least that's what's indicated by comments in the script itself:

    Code:
    pagelinks[i].onclick=function(){
    thumbnailviewer.stopanimation() //Stop any currently running fade animation on "thumbbox" div before proceeding
    thumbnailviewer.loadimage(this) //Load image
    return false
    }
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. I'll ask more help in few days. I'm doing testing right now and found that some images are opening in a new window and other images works as expected, I'm talking about the large ones, not the preview ones.

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
  •