Results 1 to 4 of 4

Thread: Can Image Thumbnail viewer be altered to open an iframe?

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can Image Thumbnail viewer be altered to open an iframe?

    1) Script Title: Image Thumbnail Viewer

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

    3) Describe problem:
    Hi, great script. I am currently using it with cmotion for my portfolio site, here http://www.jimdaug.com/gallery.html. I wouldn't call myself a great programmer, but I seem to know enough to understand the scripts involved. I would like to alter the thumbnail script to display videos in .mov and .wmv format on a different gallery page. My first idea was to alter the part that generates the html for the image source and change it to an iframe.

    instead of this:
    Code:
    var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" />'
    this:
    Code:
    var imageHTML='<iframe src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" > </iframe>'
    
    using this as the link in the body:
    <a href="movs/swat2.mov" rel="thumbnail">  <img src="images/thumbnails/BW/swatWire.jpg" name="swatWire" id="swatWire" /><br></a>
    but it doesn't work. The loading .gif comes up, but then the browser just goes to the file like I had clicked on a normal link. same with an html as the href. There is obviously more going on than I understand. This seems pretty simple and I understand 90% of the code. There must be something simple that I am missing. Thanks for any help you can provide. Link to test page http://www.jimdaug.com/vidGalleryTest.html
    Last edited by jimdaug; 11-26-2007 at 04:26 AM.

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

    Default

    Hmm that definitely won't work. Getting this script to load IFRAME content would require some rather extensive modifications. Right now the closest thing I can think of on DD for this would be DHTML window widget actually, namely, the IFRAME option.

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

    Default

    The DHTML window widget isn't exactly what I had in mind, but thank you for the reply.

    If I understand the script, It's basically using the rel="thumbnail" attribute to differentiate those anchors from others that would be on the page, then writes out a div and puts the image source inside it.

    What is preventing me from putting something else in that div besides an image?

    EDIT starts here...

    So after racking my brain for a while I figured out how to do it. And it was quite simple. I modified the html link in the body to look like so
    Code:
      <a href="images/jpegs/swat.jpg" rel="thumbnail" attr="movs/swat2.mov"> 
      <img src="images/thumbnails/BW/swat.jpg"  name="swat" id="swat" />
      </a>
    Then changed the loadimage:function in the thumnailViewer.js file to this
    Code:
    var imageHTML='<img src="'+link.getAttribute("href")+'" width="0" style="'+this.opacitystring+'" />' //Construct HTML for shown image
    imageHTML+='<iframe src="'+link.getAttribute("attr")+'" width="640" height="495"> </iframe>'
    The only caveat currently is the size of the iframe has to be coded into the javascript file. With a little more time, I should be able to size it dynamically.

    I'm open for suggestions too. If there is a better way to do it please let me know.
    Last edited by jimdaug; 11-26-2007 at 06:08 AM. Reason: figured out a solution

  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

    - John
    ________________________

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

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
  •