Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: YUI Lightbox

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

    Overall, the smoothness of the script appears equivalent or superior to lightbox in FF. The choppiness in FF that I see is only with the two variant demos. Without diagnosing it, mind you, just from the look of it, it seems as though you are waiting too long to determine the page or window width or more likely the height (a vertical scrollbar appears briefly) or skipping a step, or allowing the image to load into the 'box' while the 'box' is 'below the fold' and then centering the 'box'. This is only noticeable on screens/in windows that are tall enough not to need a vertical scrollbar to display the page to begin with.
    - John
    ________________________

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

  2. #12
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    jscheuer1: great information, I have some detective work to do. Also, admin, I will add the fact that Yahoo provides hosting for API files. But I also include all needed files in the ZIP file.

    UPDATE: Added support for loading photos via AJAX. You can create an XML file, load it then view the lightbox. I made several other enhancements and ffixes as well.

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

    Default

    The XML file ability is certainly a plus. I think by the time this script emerges out of beta, it'll certainly be a script I'd like to feature on DD.

  4. #14
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    The XML file ability is certainly a plus. I think by the time this script emerges out of beta, it'll certainly be a script I'd like to feature on DD.
    Awesome!

    I'm a few weeks away from releasing the first stable version. I have a list of enhancements to add and then I need to spend some quality time testing browsers and platforms. I'll keep this thread updated with my progress.

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

    Quote Originally Posted by modulo View Post
    jscheuer1: great information, I have some detective work to do. Also, admin, I will add the fact that Yahoo provides hosting for API files. But I also include all needed files in the ZIP file.

    UPDATE: Added support for loading photos via AJAX. You can create an XML file, load it then view the lightbox. I made several other enhancements and ffixes as well.
    I ran into a similar problem when coding my lightbox 'clone':

    http://home.comcast.net/~jscheuer1/side/mybox/

    My script was never meant to be a replacement for lightbox. It was meant to offer a wide variety of 'box' options with very low overhead and no reliance on outside script libraries. As a result, it has few special effects.

    Anyways, in FF I remember that the 'box' would cause a vertical scrollbar if I didn't calculate its position twice. Other browsers had their own idiosyncrasies as well. There could be a better solution, I did this:

    Code:
    boxLoc:function(obj){
    var m=mybox, w=window, ow='offsetWidth', oh='offsetHeight', sw='scrollWidth', sh='scrollHeight', cw='clientWidth', iw='innerWidth';
    if(obj==m.loading)
    m.olay.style.height=m.olay.style.width='';
    if(obj==m.box)
    m.box.style.top=m.box.style.left='';
    m.olay.style.height=Math.max(m.iedb()[oh], m.iedb()[sh])-(m.ie6ha? m.ie6ha() : 0)+'px';
    m.olay.style.width=m.ie6ha?m.iedb()[sw]:Math.max(m.iedb()[ow], m.iedb()[sw])+'px';
    var portH=w.innerHeight || m.iedb().clientHeight;
    var portW=w[iw]&&m.iedb()[cw]? Math.min(m.iedb()[cw],w[iw]) : w[iw]? w[iw] : m.iedb()[cw];
    var tS=self.pageYOffset || m.iedb().scrollTop || 0;
    obj.style.top=(obj==m.loading||(obj[oh]<portH&&(!obj.firstChild||obj.firstChild[oh]<portH))? portH/2-obj[oh]/2 + tS : tS + 20)+'px';
    tS=self.pageXOffset || m.iedb().scrollLeft || 0;
    obj.style.left=(obj==m.loading||(obj[ow]<portW&&(!obj.firstChild||obj.firstChild[ow]<portW))? portW/2-obj[ow]/2 + tS : tS + 20)+'px';
    if(m.iedb()[sh] < m.box[oh]+m.box.offsetTop+29||m.iedb()[sw] < m.box[ow]+m.box.offsetLeft+29){
    m.olay.style.height=m.olay.style.width='';
    if(m.iedb()[sh] < m.box[oh]+m.box.offsetTop+29)
    document.body.style.height=m.box[oh]+m.box.offsetTop+(m.ie6ha||document.body.filters?25:10)+'px';
    if(m.iedb()[sw] < m.box[ow]+m.box.offsetLeft+29)
    document.body.style.width=m.box[ow]+m.box.offsetLeft+25+'px';
    m.olay.style.height=Math.max(m.iedb()[oh], m.iedb()[sh])-(m.ie6ha? m.ie6ha() : 0)+'px';
    m.olay.style.width=m.ie6ha?m.iedb()[sw]:Math.max(m.iedb()[ow], m.iedb()[sw])+'px';
    }
    }
    Full code available from the above link.

    To make a long story short though, since you are adding your 'boxes' to the end of the document (as is generally preferred - I added my one box to the beginning because of iframe counting), it would be imperative to position them before displaying (display property) and to zero out their height before determining their style height. Remember, an image's height attribute may be determined once it is loaded/preloaded, without the need to display it.
    - John
    ________________________

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

  6. #16
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    More great info John, much appreciated. I just releaved v0.7 with a number of updates enhancements and fixes. I also style the page a little, make it easier on the eyes.

  7. #17
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Hello,
    The lightbox doesn't work in IE6.0: the thumbnails don't show; just big pictures. Is there a fix?
    Arie Molendijk.

  8. #18
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by molendijk View Post
    Hello,
    The lightbox doesn't work in IE6.0: the thumbnails don't show; just big pictures. Is there a fix?
    Arie Molendijk.
    Being that it is still in BETA stage I have not started on support for deprecated browsers. Once I have it stable for current version browsers I will start to work on IE6 compatibility.

  9. #19
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Just released 0.92. I'm done with the feature set until version 1 gets released. I am now going to focus on bugs and browser compatibility.

  10. #20
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Added some new features. Slideshow mode and added paging butons a la flickr paging. Still haven't gotten to IE6/Opera/Safari1.3 support, soz. if anyone has those browsers it would be great to know what works, if anything.

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
  •