Results 1 to 2 of 2

Thread: Another "Lightbox image viewer" question: Image scaling

  1. #1
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Another "Lightbox image viewer" question: Image scaling

    1) Script Title: Lightbox image viewer 2.03a

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


    3) Describe problem: Hi all!
    I would like to cancel the title tag tool tip on hover a link, not the linked caption on big image lightbox. It is very annoying because most of the time is a mere echo of the actual link and if I combine plain text plus a link reference the internal code is visible.

    I found on forum the thread "Image thumbnail viewer 2 : add target="_blank" to link ?"
    http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    that gives the following solution:

    Code:
    <script type="text/javascript">
    (function(){
    if(document.body.getAttribute)
    for (var i = 0, l=document.links; i < l.length; i++)
    if(/enlargeimage/.test(l[i].getAttribute('rel'))){
    l[i].caption=l[i].getAttribute('title');
    l[i].removeAttribute('title');
    }
    })();
    </script>
    
    </body>
    </html>
    and change something in the OLD code version, not in the NEW one.

    So I changed only "enlargeimage" for "lightbox" and, at first look, it seems to work. But it also hide the text and link of caption in the modal window!

    Any idea?

    --------------

    A second more important question to me:

    I work only with small thumbnails and big images.
    There is any way to modify the code to specify in each of the links or thumbnail images the "desired" final dimensions?

    Or better yet, to simplify, is it possible to modify the DD code or the new one of the author to scale the lightbox final image HALF OF the original/actual size? That is, 50%... The latter solution is what I really need.

    v 2.05
    http://www.lokeshdhakar.com/projects...box2/#download

    Thanks in advance for your replies.

    Luys
    Last edited by Luys; 04-30-2011 at 08:48 PM. Reason: Accuracy

  2. #2
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default I need some help on image scaling

    Hi!
    1.- Well, I think the only solution to title attribute of the text link issue, is give it up and opt for a thumbnail with its corresponding label, so that the title tag of the link is hidden and continues to operate the caption on modal window.

    2.- As the authors considered outdated version years ago, and to avoid future incompatibilities, I direct my efforts to the new version 2.05. I managed to resize the container to half the original size of images changing the line 265 of lightbox.js file:

    Code:
    this.resizeImageContainer(imgPreloader.width / 2, imgPreloader.height / 2);
    Is it right? Or rather, must be enclosed in parentheses?

    Code:
    this.resizeImageContainer((imgPreloader.width / 2), (imgPreloader.height / 2));
    3.- Unfortunately, I have not known how to change the code so that it scales the images to half the original size (i.e., 50%): I'm still having a large image on screen over a properly sized container bottom.

    Could someone with extensive knowledge be so kind as to review the code of lightbox.js v 2.05 and find the "immediate" solution or possibly create the appropriate function?

    I'm in a real impasse... Thanks in advance for your replies.

    Luys

    v 2.05
    http://www.lokeshdhakar.com/projects...box2/#download
    Last edited by Luys; 04-30-2011 at 08:43 PM.

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
  •