Results 1 to 10 of 10

Thread: Is ThumbnailViewer2 compatible with Control Modal?

  1. #1
    Join Date
    Apr 2007
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Is ThumbnailViewer2 compatible with Control Modal?

    1) Script Title: thumbnailviewer2.js

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

    3) Describe problem:

    Not a problem per se, more of a conflict... I am wondering if thumbnailviewer2 can be used in conjunction with Control Modal (http://livepipe.net/projects/control_modal/)

    See what happens when they try to co-exist :
    http://www.vilverset.com/jim.html

    Click the 2nd thumb on the left column (1st of second row). You'll see an HTML page overlay everything. This page is made up of 1 main image and 3 more thumbnails, using thumbnailviewer2.js.

    Hovering over these 3 thumbs does nothing. Not even an error. But when I try it standalone, it works. Obviously, there is a conflict with Control Modal and/or Prototype.

    Can someone much more experienced than me spot the conflict and tell me how hard it would be to resolve it, if after taking a look it turns out that that's not even possible, then I'll stop trying.

    Thanks!

  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

    This:

    Code:
    <script type="text/javascript" src="/scripts/thumbnailviewer2.js" defer="defer"></script>
    needs to be like so:

    Code:
    <script type="text/javascript" src="/scripts/thumbnailviewer2.js" defer="defer">
    /***********************************************
    * Image Thumbnail Viewer II script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    </script>
    This:

    Code:
    <a href="pics.html" class="tn modal">
    Should be like:

    Code:
    <a href="pics.html" class="tn modal" onmousedown="thumbnailviewer2.alreadyrunflag=0;">
    Then on pics.html:

    Code:
    <table onmouseover="if(!thumbnailviewer2.alreadyrunflag){thumbnailviewer2.alreadyrunflag=1;thumbnailviewer2.init();};" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="left" valign="bottom"><div id="loada . . .
    That should at least get it working one time, if there are other problems, the cleanup function may need to be run (and perhaps should be anyway) with the onmousedown:

    Code:
    <a href="pics.html" class="tn modal" onmousedown="if(thumbnailviewer2.targetlinks&&(thumbnailviewer2.targetlinks.length||thumbnailviewer2.featureImage)){thumbnailviewer2.cleanup();}thumbnailviewer2.alreadyrunflag=0;">
    Last edited by jscheuer1; 04-24-2007 at 04:53 PM. Reason: add missing ) to cleanup code
    - John
    ________________________

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

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

    Default

    Thanks, John. Sorry about the legal note in the header, these are just testing files and I was trying to isolate where the conflicts are, so all comments were stripped for the occasion.

    It works great on IE6. Didn't try anything else yet but usually when something works on IE6, the worst of it is over.

    Thanks.

  4. #4
    Join Date
    Apr 2007
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Works, but only for 1 instance...

    I noticed this code works fine as long as there's only 1 instance of calling an HTML page via Control Modal on any given page.

    But it gets hairy when you've got 2 :

    http://www.vilverset.com/jim.html

    In the first thumbnail column, the 2nd and 3rd images link to 2 different HTML pages. As you can see, there are errors galore right now.

    How do I fix?

    Thanks!

  5. #5
    Join Date
    Apr 2007
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Found the mistake : missing ")" after the cleanup code.

    Fixed it..!

  6. #6
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default multiple pages don't work

    Hi, I ran across the issue where if you try to use this .js for multiple pages, it will not unload images. Does the : missing ")" fix this?? If so, where exactly does it go??

    Thanks!

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

    I thought they meant they left it out. However, I did, it should be:

    Code:
    if(thumbnailviewer2.targetlinks&&(thumbnailviewer2.targetlinks.length||thumbnailviewer2.featureImage)){thumbnailviewer2.cleanup();}thumbnailviewer2.alreadyrunflag=0;
    I will now go and edit the original post.
    Last edited by jscheuer1; 04-24-2007 at 06:40 PM. Reason: clarify
    - John
    ________________________

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

  8. #8
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Super! Thanks so much! Please let us know when the new one is posted.

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

    I meant the original post, I fixed the error in the original post. DD doesn't let me edit the scripts in the library - yet.
    - John
    ________________________

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

  10. #10
    Join Date
    Apr 2007
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry for being unclear. The missing ")" was indeed missing from John's recommended code. It wasn't me who forgot to put it.

    I don't know much about javascript, but I was able to spot the error by comparing the if statement to other code I had.

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
  •