Results 1 to 8 of 8

Thread: Links Not Working?

  1. #1
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Links Not Working?

    1) Script Title: Image Thumbnail Viewer II

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

    3) Describe problem: I hope that this issue hasn't already been discussed, I didn't find it anywhere. I am using the thumbnail viewer II on our site and it works great! Love it! The only problem I am having is that I am unable to get the links to work to enable the user to click on the small image (gif) to open up a large picture in a new window. There must be something silly I am doing. Any help would be greatly appreciated.


    monet1369

  2. #2
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I do apologize, as I should have included the url to our website. It is as follows: http://www.oldhickory.com/html/newitems.html

  3. #3
    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 script doesn't do that. And, as this script does open the larger image right on the page, why would you want it to?
    - John
    ________________________

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

  4. #4
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the info. My boss wants this script to open the larger images. I guess our reps are complaining. Picky, picky.

    Thanks!

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

    What the script can do is open a page onclick of the larger image:

    Code:
    <a href="../catalog/deaconbench.jpg" rel="enlargeimage::mouseover" rev="loadarea::../catalog/deaconbench.jpg"><img src="../catalog/deaconbench.gif"></a>
    However, that will not be a new window. It could be made to be one by editing the script here:

    Code:
    imageHTML='<a target="_new" href="'+dest+'">'+imageHTML+'</a>'
    - John
    ________________________

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

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

    Now, this is a bit tricky. But, if you have your rev attributes set correctly as shown in my previous post, you can get the thumbnails to use those as well to open a new window onclick by adding this script right before your closing </body> tag:

    Code:
    <script type="text/javascript">
    function link_em(){
    var link_func=function(e){
    var e=window.event? window.event : e? e : null;
    var lk=e&&e.target? e.target.parentNode : e&&e.srcElement? e.srcElement.parentNode : null;
    if(lk&&lk.getAttribute('rev',0)&&lk.getAttribute('rev',0).split('::')[1])
    window.open(lk.getAttribute('rev',0).split('::')[1]);
    return false;
    }
    for (var i_tem = 0, ls=document.links; i_tem < ls.length; i_tem++)
    if(/enlargeimage/.test(ls[i_tem].getAttribute('rel',0)))
    ls[i_tem].onclick=link_func;
    }
    if ( typeof window.addEventListener != "undefined" )
        window.addEventListener( "load", link_em, false );
    else if ( typeof window.attachEvent != "undefined" )
        window.attachEvent( "onload", link_em );
    else {
        if ( window.onload != null ) {
            var oldOnload = window.onload;
            window.onload = function ( e ) {
                oldOnload( e );
                link_em();
            };
        }
        else
            window.onload = link_em;
    }
    </script>
    - John
    ________________________

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

  7. #7
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much for all of the suggestions! I will definitely give them a try.


  8. #8
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That worked like a charm! Thanks sooo much!

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
  •