Results 1 to 5 of 5

Thread: Image Thumbnail Viewer II integration with another script

  1. #1
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image Thumbnail Viewer II integration with another script

    1) Script Title: Image Thumbnail Viewer II

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

    3) Describe problem:

    I would like to integrate the thumbnail viewer script with the one on this page http://www.jtricks.com/javascript/wi..._centered.html so that when I click on the enlarged image, the pop-up box is displayed with the contents of another page.

    So far my amateurish attempts have been unsuccesful. I have tried copying the pop-up centred box script into the page header then (unsuccessfully) amending the thumbnail2 javascript line

    imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
    to

    imageHTML='<a href="'+dest+'" onclick="return show_hide_box(this, 200, 270, '2px solid')">'+imageHTML+'</a>'
    in an attempt to invoke the pop-up box centered script but this doesn't work (embarressed smilie here).

    Could someone perhaps suggest a method of integrating these? If it's too complex I won't bother but I was hoping that there is a simple solution.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    In this function of thumbnail2.js, add the highlighted parts:

    Code:
    loadimage:function(linkobj){
    var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image
    var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
    var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any
    var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
    var imageHTML='<a href="'+imagepath+'" onclick="return show_hide_box(this, 200, 270, \'2px solid\')"><img src="'+imagepath+'" style="border-width: 0" /></a>' //Construct HTML for enlarged image
    if (typeof dest!="undefined") //Hyperlink the enlarged image?
    imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
    if (description!="") //Use title attr of the link as description?
    imageHTML+='<br />'+description
    if (this.iefiltercapable){ //Is this an IE browser that supports filters?
    showcontainer.style.filter=this.iefilterstring
    showcontainer.filters[0].Apply()
    }
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks for the response testingsite

    I tried the replacement you suggested by it didn't not work.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Can you post a link to the problem page so that we can see what's going on with it?
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    I just noticed that if you are using the script that you posted a link to (the centered box), there is no function called show_hide_box, but instead show_hide_centered_box. If you replace the part I posted before with this, it should work fine. But again, in any case, please post a link to the problem page.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •