jQuery Lightbox V0.2
Filed in: javascript, jquery Add comments
NOTE: jQuery Lightbox v0.2 is a very old release. I’ve recently released version 0.5 and highly suggest you download that release as it fixes many bugs that exist in v0.3 as well as introduces a host of new features.
A quick update to the jQuery Lightbox i’ve been working on. Version 0.2 include:
- Refactored straight DOM manipulation in favor of jQuery’s .appen() method.
- Removed several dead functions
- Encapsulated the whole object, so as not to rely on external functions (some function names may have conflicted with other libraries, etc.)
It’s a minor change, and is still functionally the same, but it’s getting closer to what I want it to be. Get it while it’s hot!!
August 1st, 2007 at 8:51 am
Hi Warren,
I’ve found 2 minor bugs with Firefox 2.0.0.5
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
- If you click on the “close” image, you’ll get some scrollbars. If you click on “close” again, lightbox really closes.
All the best
Martin
August 1st, 2007 at 5:57 pm
[…] There’s already a new code release, which you can see here, or you can look at the first version […]
August 2nd, 2007 at 11:50 am
Hey thanks for putting this together! Something that I noticed is when you go from image to image, it stalls on the third image (if it’s the first or last one). Might want to have a look.
Tim
August 3rd, 2007 at 6:51 pm
[…] been a few days, and several people have downloaded the jQuery Lightbox. I’ve already received some feed back, and have isolated a few issues. The current bugs […]
September 9th, 2007 at 3:54 pm
Looking forward to this, it’s exactly what I need, how did you convert it, I’d like to try to try my luck with porting slimbox(http://www.digitalia.be/software/slimbox#get_help) to jQuery. I love the lightbox but I didn’t like the layout and the fact that you needed to hover over the image to display the gallery navigation, it was easy to modify this on the slimbox.
September 10th, 2007 at 2:16 am
if(!(hDiff == 0)){
$(’#outerImageContainer’).animate({width: widthNew},400,’linear’,function(){
if(!(wDiff == 0)){
$(”#outerImageContainer”).animate({height: heightNew},400,’linear’,function(){
Lightbox.showImage();
});
}
});
}
//there are two asserts: hDiff==0 and wDiff==0, so if an image shown last time, hDiff and wDiff are all zero. this method will not be called: Lightbox.showImage();
September 10th, 2007 at 2:18 am
Martin Says:
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
you can remove “if(!(hDiff == 0)){” and “if(!(wDiff == 0)){”, it will work well.
September 10th, 2007 at 2:19 am
Martin Says:
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
—————–
remove “if(!(hDiff == 0)){” and “if(!(wDiff == 0)){”, it will work well.
September 10th, 2007 at 2:29 am
Martin Says:
August 1st, 2007 at 8:51 am
Hi Warren,
I’ve found 2 minor bugs with Firefox 2.0.0.5
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
**********************************
remove “if(!(hDiff == 0)){” and “if(!(wDiff == 0)){”
**********************************
- If you click on the “close” image, you’ll get some scrollbars. If you click on “close” again, lightbox really closes.
**********************************
update file of lightbox.css:
from:
#imageData #bottomNavClose {
width: 66px;
float: right;
padding-bottom: 0.7em;
}
to:
#imageData #bottomNavClose {
width: 66px;
float: right;
margin: 1.0em;
}
**********************************
September 10th, 2007 at 2:30 am
Martin Says:
August 1st, 2007 at 8:51 am
Hi Warren,
I’ve found 2 minor bugs with Firefox 2.0.0.5
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
**********************************
remove “if(!(hDiff == 0)){” and “if(!(wDiff == 0)){”
**********************************
- If you click on the “close” image, you’ll get some scrollbars. If you click on “close” again, lightbox really closes.
**********************************
update file of lightbox.css:
from:
#imageData #bottomNavClose {
width: 66px;
float: right;
padding-bottom: 0.7em;
}
to:
#imageData #bottomNavClose {
width: 66px;
float: right;
margin: 1.0em;
}
**********************************
September 12th, 2007 at 2:05 am
fix some bugs and add new features:
- First click on a thumbnails opens the lightbox. After you’ve closed it, and you want to open it again, nothing happens.
- If you click on the “close” image, you’ll get some scrollbars. If you click on “close” again, lightbox really closes.
- Button auto slideshow, pause and play
- Button goto first and last page
- While resize window, overlay is not fit the new size.
September 16th, 2007 at 8:03 pm
Hi Warren,
thanks for putting this together! I’ve given it some extra love and fixed several bugs to have it completely working smoothly with jQuery. The result is a ~5 KB (packed) JavaScript. Furthermore, I’ve integrated the script in a Drupal module (Drupal 5+ integrates the jQuery library in core), which is named jQuery Lightbox. I hope that’s okay with you!
Keep up the good work!
greetings,
sun
September 21st, 2007 at 1:54 pm
Hi,
I’ve found one more bug - sometimes if you navigate through images, lightbox skips more than 1 image, so with one click you can go from picture 10 to picture i.e. 7. Moreover, lightbox freezes when it wants to go from picture 1 to picture -5 (JS error). I’ve corrected it with something like that:
1. added to lightbox variables declarations:
isChanging : false,
2. added 2 lines at the beginning of changeImage():
if( Lightbox.isChanging ) return;
Lightbox.isChanging = true;
3. added 1 line at the end of onload handler for imagePreloader:
Lightbox.isChanging = false;
and now it works fine
Regards,
jk