Lightbox 2.7.5 plugin for WordPress
Get the latest version here . Click a thumbnail pic to see it in action. Learn more about this plugin.
Note to existing users: Auto-lightboxing of image-links is now enabled by default. lightbox-auto is no longer necessary.
Lightbox 2 allows you to present images in a slick window, while darkening the rest of the page. It makes your site look professional, and adds very little to page load times. It does not require any browser plugins to work, and works on just about every web browser out there! When a browser doesn’t support javascript, your web site still looks and works fine.
The brilliant Lightbox 2.2 javascript/css was written by Lokesh Dhakar . I simply made it into a WordPress plugin and added some options. Props to my man Krembo99 for initially enabling auto-lightboxing of links to images. The mighty Tanin improved thing further with his code wizardry. Thanks to both, your help is much appreciated!
To install: Put the lightbox-2 folder in your WordPress plugins folder, then activate it in WordPress.
Implementing Lightbox is now automatic . Create a link to an image to see Lightbox-2 work.
Features:
- Auto-lightboxing of all links to images in your posts. No more manually adding rel= to your links! This can be turned off in Lightbox 2 admin options. Also, no double rel= tags, thanks to Tanin.
- Grabs the title from the img title or the alt if there is no anchor title.
- Themes that determine the colours of the lightbox window. You can select from Black, White or Grey.
- No longer conflicts with any WordPress themes! This means it looks right, every time. Unless you are using a theme called stimuli_lightbox… ;)
- Uses wp_enqueue_script to prevent multiple prototype and scriptaculous libraries from clobbering each other. At least with other plugins that use wp_enqueue_script.
- This version works when wordpress is installed in non-standard locations , ie: /wordpress/ instead of /, whereas other Lightbox plugins break.
- Uses the arrow keys as well as P and N keys to navigate between images. The X and Escape keys close the Lightbox window, as does clicking anywhere outside the image.
- Minor cosmetic changes from the scripts by Lokesh.
Please read the Frequently Asked Questions included with the plugin before posting a comment!
About this entry
You’re currently reading “Lightbox 2.7.5 plugin for WordPress,” an entry on stimuli.ca
- Published:
- 06.10.08 / 7am
- Category:
- News



Sorry for the double post but I wanted to add that I am getting a error in javascript, when the lightbox is active, when I disable the lightbox2 the javascript error goes away.
Also my site is in it’s own subdomain blog.phprocket.com instead of http://www.phprocket.com/blog do you think this might cause the error ?
I have tried installing it two different ways. One I updgraded from the WordPress Script, I have also tried downloading it and installing it myself.
Looking forward to your reply.
ok i have this problem where Lightbox wont work. The problem is in my theme, (The problem is with your WordPress theme, mangling image display properties. Use another theme, that doesn’t interfere with posted images.)
For whichh tags do i have to be alert? Images just show up in a window, and not in the lightbox
Hello,
Woke up this morning and saw that lightbox was inactive and needed an update.
Even though it is inactive, the entire top portion of my site is now gray like the site looks when the lightbox pops up in Firefox… even though it’s not active…
Any help is appreciated. Thank you!
Ok, just upgraded to the new version and the problem is still there. this is a pretty big deal – please help
That’s weird. I deleted it and reinstalled the new version, activated and cleared cookies and there it went.
Strange.
Nvm – thanks for the cool plugin btw.
http://tinyurl.com/4j9gv5
thats the url im talking about. i dont know what the problem is…
Hi Rupert,
Did you consider building in an auto fit to screen of the image?
Hello, I am using Lightbox 2.7.5 and it works well with Slickr Gallery plugin. However, when I tried with images inside my blog, they dont seem to work at all. Please tell me how fix this. Thanks
Excited about the plugin and I’ve just updated to the new version. I post the gallery and when the thumbnail is clicked, it loads on a new page and then clicked again the plugin takes effect. How do you suggest I fix the problem?
Thank you!
wld,
See if this helps:
http://0xtc.com/2008/06/12/how-to-make-jquery-and-prototype-work-on-the-same-page.xhtml
Hi there.
I am having a problem with the lightbox effect feature in the new NextGen Gallery 2.7.5 when using Safari (both Mac and PC platform). The resize image feature does not resize images properly when switching from image to image. This happens when viewing your websites image gallery as well as when viewing my gallery so this seems to be plugin related issue rather than website related.
The lightbox feature worked perfectly on Safari (both Mac and PC) prior to this upgrade.
Hope you can fix this. Thanks.
Oops ! I totally posted this on the wrong site. Time to lay off the bottle. Sorry : )
I was wondering now when the “Auto-lightboxing of image-links is now enabled” what about the other plugin to make lightbox work with the [gallery] function in WordPress…I think the current add in plugin is called “Lightbox Gallery” or something I would love to get that in the official Lightbox plugin (-; thanks for a great plugin!!!
dosnt work for me.
i am using wordpress 2.5.1 and its not working!
have an idea?
thanks,
rami
Problem with Lightbox 2.7.5
When photograph is loaded with the frame around it, I can clearly see that right side of the frame is thinner than the left side. What is the problem ? I haven’t changed anything within .css file. This is happening in FireFox.
In Internet Explored, bottom portion of the frame is not as wide as the entire frame.
Help !
Fellas, I have tried at length to get this plugin to work with WordPress 2.5.1. In the end, I had to try a different solution, which worked. I switched to the lightbox 2 plugin here:
http://downloads.wordpress.org/plugin/lightbox-2-wordpress-plugin.zip
try that out, should solve your problems.
Casperson: I’ll look into the gallery function… never heard about it!
rami7250: read the FAQ that comes with the plugin.
JayL: read the FAQ as well.
Amit: this plugin works fine with 2.5.1…. that is what this site is running! However, thanks for the link!
Couldn’t get 2.7.5 to work with multiple images (gallery?) either, so had to revert to Amit’s solution.
The plugin works well with single images, but fails to load anything other than the first image on a new page when there is multiple images set with the rel=”lightbox[gallery]” attribute.
Hi,
I have until today been using a manually installed Lighbox installation. It suddenly stopped working with IE, so I thought I would take the opportunity to try your plugin.
It works great, so thanks for that. I have noticed one thing. It takes the ALT text from the thumbnail rather than using the TITLE text from the full size.
I have generic text for the ALT in the thumbs but specific text in the full size TITLE. I have way too many images to edit them.
Is there a way to alter how this works?
I’ve had a quick look at the script but I’m a cut and paste kinda coder.
TIA
Phillip
Torger: I can’t replicate the problem, as seen with this site…
PlanetPhillip: There is a cascading order of title-grabbing. Href alt is first, followed by title. Open lightbox.js and search for ‘alt’ and you’ll find the JS that does the trick. Re-order them to your liking.
Torger: what plugins are you running?
Rupert,
Thank you for the reply. Unfortunately I can’t seem to get this to work. When I look at the code it seems that the TITLE comes first and then ALT.
HEre’s what I have in my script:
// loop through anchors, find other images in set, and add them to imageArray
for (var i=0; i<anchors.length; i ){
var anchor = anchors[i];
if (anchor.getAttribute(‘href’) && (anchor.getAttribute(‘rel’) == imageLink.getAttribute(‘rel’))){
// check for title-less links, and grab image title if needed
stimuli_image_title = “”;
stimuli_image_title = anchor.getAttribute(‘title’);
if (!(stimuli_image_title)) {
stimuli_image_title = anchor.childNodes[0].getAttribute(‘title’);
}
if (!(stimuli_image_title)) {
stimuli_image_title = anchor.childNodes[0].getAttribute(‘alt’);
}
imageArray.push(new Array(anchor.getAttribute(‘href’), stimuli_image_title));
}
}
imageArray.removeDuplicates();
while(imageArray[imageNum][0] != imageLink.getAttribute(‘href’)) { imageNum ;}
}
It seems it should be taking the TITLE from the HREF link but in my case it takes the ALT from the IMG.
TIA
Phillip
Great…I think many above is talking about the same thing.
The [GALLERY] option for many uploaded pictures dosent work, and this plugin schould work (But dosent for me) but my hope was that Rupert will look into that (-;
Thanks again for the great work!
Ohh and the link to the plugin here:
http://wordpress.org/extend/plugins/lightbox-gallery/faq/
Okay, I’ve read the FAQ, but still don’t know how to modify my site’s css to improve the way Lightbox works. In short, the “close” button works only for really small images, while larger ones… to close them you need to click outside the image area.
Other than that, what I miss the most is the localization options (.po and .mo?). But don’t listen to me, I love the plugin anyway. :)
is there a way to disable the auto-lightboxing per post or per page? I have just one page that needs regular image links, but the rest of my site needs the auto function.
I seems that the plug-in has an issue switching from landscape to portrait. I’m not sure why.
http://www.commitsnowandskate.ca/wp/photos/?album=1&gallery=4
Have the same problem as Halibutt, can’t make the “close” button work. It is there, but you can’t click it. You have to click anywhere, or press escape, to close the popup.
getting a php error:
PHP Fatal error: Call to undefined function update_option() in /var/www/html/myblogdirectory/wp-content/plugins/lightbox-2/lightbox2.php on line 13
did a google on this and pages results with this error…is there a fix?
I am suddenly having a weird issue. At ryanbillingsley.com, one post with images works fine with lightbox, where the most recent will dime but then just load the image by itself. I am just using the auto lightbox feature so I can’t figure out why one will work and one won’t?
I’m with some of the other folks above: I’d love to see this work with the Gallery shortcode in WP 2.5.
I just updated my Lightbox plugin at my wordpress site to version 2.7.5. But the strange thing now is that none of my images displays with the lightbox-effect. It starts off by fading out the page (white), then it opens the picture in a new window…
Can anyone think of a solution for this?
2.7.5 is not working for me, I had to switch until this version is repaired, there is another site that has the same lightbox 2 plugin http://www.4mj.it/lightbox-js-v20-wordpress/ and it’s working correctly, but it does not have all the same bells and and charms but at least it’s working. I will keep checking back for this version of the lightbox 2.
I was having the same problem that Tech Help had in Safari:
“The resize image feature does not resize images properly when switching from image to image.”
The problem was that somewhere in there, a width was being added to the IMG tag when the first image was loaded, and this value was not updated for other images! I’m not sure if it was this plugin or another plugin that was the culprit, but I tried deactivating other plugins and the problem persisted.
The solution was to add the following line somewhere in resizeImageContainer (I added mine around line 440):
$(‘stimuli_lightboxImage’).removeAttribute(‘width’);
Hope that helps someone!
I have a YouTube video on the page that sits over the image that opens up in lightbox in wordpress. Is there a way to overcome this? The image basically appears behind the video box, instead of over it like the rest of the content.
ha, figured it out.
added to the movie parameters and it works.
param name=”wmode” value=”transparent”
I am using the helowiki theme and this version of lightbox breaks the design. Have not figured out how.
http://hellowiki.com/2008/03/30/theme-hello-d-fixed
Have used the plugin for some time with great satisfaction – thanks!
However: after upgrading to latest version of WP and the latest version of the plugin, it has mysteriously stopped working – nothing happens when clicking a picture.
Have a manual install of Lightbox on another part of the site (Album) that works OK.
Disabling all plugins and switching to default theme didnt help.
My new PhotoJAR: Base plugin can display a WordPress 2.5.1 gallery using this lightbox plugin. See it in action and download the plugin from http://www.jarinteractive.com.
Hey there I just wanted to know how I can manage the Lightbox Installation on the Plugins page. There is no link or anything. Do I just use it automatically or…? Thanks.
Hi, i think there may be a conflict between your lightbox plugin and the wp-piclens-plus plugin. If the piclens plugin is active, lightbox-2 doesnt work right. Could be a function/var overlap. Im getting errors saying ‘pause is not a function’.
Cor
Why, in FIREFOX3 under is a normal! But IE7 will be no effect on this
I have similar problems with [gallery] (only first image loads).
I think I have traced it to incomptibility to Post Thumb Revisited plugin. Any idea on how to sort this?
I’m having the same problem as Ryan above. Some of my Lightbox images are working just fine (in both IE7 and FF3) while others seem to begin the ‘fade’ and then fail and just load the image in place of the page rather than in a lightbox.
You can see this in action at http://www.holycow.com/dreaming/ — the Heliogabolous entries aren’t working while the small “Stardust” a few posts down works just fine.
Ok, I’ve rolled back to version 2.2.2 (and using the “Add Lightbox” plugin to get automatic lightbox on links) and those images are working agin. I’ll upgrade from here to new Lightbox versions step by step until the entry breaks again and report back what I’ve found.
I’ve determined the point of error — version 2.7 and later were the first to use the Javascript file and that’s causing the problem somehow. I don’t have the JS knowledge to figure out what’s going on. My guess is it breaks on files over a certain size but I could be completely wrong.
Latest working version is 2.6.5 (NOTE: 2.6.6 *should* work but the link to that zip file on the WordPress download site actually contains 2.7.2!) which you can see working here: http://www.holycow.com/dreaming/stories/being-an-account-of-the-life-and-death-of-the-emperor-heliogabolous
I’ve copied that exact entry’s HTML into my testing blog using the newer plugin to show 2.7.5 non-functioning: http://www.joefulgham.com/2008/07/11/testing-lightbox-errors/
In short, if people are having this problem use the 2.6.5 version of the plugin until this gets fixed.
Rupert, feel free to contact me if you’ve like me to try out some changes on my test blog to get it working!
I use another plugin for a photo album which creates albums on pages but when clicking on those photos it doesn’t work. Is there something i can add to that plugin so it can use the lightbox plugin? Now when i post pics within the main site the lightbox works like a charm.
Thanks
Hello.
Is there a way to turn off auto-tagging for a post? I sometimes need to turn auto-tagging off because I show nextgen-gallery enabled pictures in some of my posts, but not all of them.
Thank you.
When will update for wordpress 2.6?
Yes, please update it for WP 2.6 as soon as you can, and thanks a bunch for making the plugin in the first place.
After upgrading to latest version of lightbox, it stopped working .
In all posts created since june 2007 lighbox doesn’t work anymore.
Here is the detail of the configuration which doesn’t work:
WP 2.6 lightbox 2.7.5 thème: dezinerfoli black stripe
the url of my site:
http://www.sylviehumbert.com/paru2007
Could you help me to solve my problem, do I need a downgrade ?
I have another site which works fine with those parameter:
WP 2.3.3 Lighbox 2.5.0 Thème: dezinerfoli black stripe
http://www.jejoueaugolf.com
It would be really nice if there were a way to integrate with videobox as well. That way links to flash objects could be used in image sets. Just dreaming over here since I use this for portfolio representation.
Hi,
Firstly, thank you for this wonderful plugin. It is compatible with all the WP themes which I’m currently using and compatible with most of the plugins I’ve installed.
For some reasons, however, it does not work when I have the WP e-Commerce plugin activated.
I had updated to WP 2.6 and the plugin still works. As for browsers, it works fine for me on both IE7 and FF3.
http://tinyurl.com/5eqqcn the problem is here, look at the link of EXAMPLE 1
Please let me know the solution, thanks
I had the same problem than Joe Fulgham (some pictures don’t show with the effect). I will try his solution…
looks great, but it doesn’t work on my site… it keeps open in a new page… could you give me some advice?
The “close window” button doesn’t work. See here: http://www.krishnagallery.com/2008/07/vrindavan-sita-wedding-engagement-yajna/
Any suggestions?
The plugin is working with nextgen plugin.
Dear publisher
I have to say that your plugin ROCK!!!! I love it, it’s so easy to use and implement, is just fantastic.
Thank you very much for this amazing plugin.
There is only one thing that I think it could be in the next upgrade. Would be possible to link any text to an image?
I believe the script is taking data from the thumb image, but when is a text link it doesn’t find it and stop working.
If there is a solution for this please let me know.
Again, thank you very much
Bruno.
First of all my compliments for your great plugin. Secondly, the plugin is not completely working on my Safari browser on my mac. The problem also accurs on your owns site with the examples you placed. The first time you click an image everythin is fine. But when you open an second image of a different size, the image is not displayed in de imagecontainer but partly sticking out of the sides. Do know a sollution for this problem? Thanks in advance
This plug in is exactly what I was looking for, and it works perfectly. Great job.
However, I would like to add a link to the caption portion below the image, that would open the comments for the image in a new window. How do I do this?
(I know how to make the link open the comments pop-up, the question really is how I get this link to appear in the caption.)
Thanks in advance.
I think I found the error why it sometimes works and sometimes doesn’t. It’s simple, actually: It doesn’t work if your link tag has no title attribute and if you have a space character between the link and the image tag. Because then the plugin tries to look for a title on the image in the link, but it gets the wrong node — spaces are nodes too in a Firefox DOM.
The plugin author needs to check what imageLink.childNodes[0] in line 342 of lightbox.js returns. Or is that rather a lightbox bug?!
Great plugin! Seriously a lifesaver compared to all the other lightbox plugins… I was wondering if there was a way to add more than three columns of photos?
Fabulous plug-in! Thank you – I appreciate your work! I do have a question. . .how can I change the title of the photo that displays when you hover over the picture and when you open the picture? I have no problem labeling each photo when I upload them, I just can’t seem to find where to change the picture title. Thanks again!!
I just made a discovery that I thought I would share with others. Lightbox 2.7.5 would not work in IE7 but it works fine in Firefox.
After reading the troubleshooting section, I decided to do as sugguested with plugins and disable all and then try them one at a time to see if any were conflicting with lightbox.
It turns out that “Live Search Popup” (http://wordpress.org/extend/plugins/live-search-popup/) is the culprit. As soon as I deactive that plugin, lightbox works again.
Since I like both of these plugins, I am hoping that one of the plugin authors will find a way to make them play together (smile).
Hope that this may help someone and they won’t have to go through deactivating and reactivating all their plugins to find why lightbox won’t work.
Is there a way to limit the size of the image in the lightbox popup?
last photo uploaded is bigger than the browser window in the lightbox. Or do I have to reload a half-size image?
For all users who got a problem with Lightbox and PicLens etc.:
Both Plugins use the pause function.
Just change the word “pause” in the lightbox.js into lbpause – than both Plugins will work together.
See comment from Joel (06.19.08). Same question, is there a way (code) to disable auto-linking on a specific page? On my specific page (portfolio) i need to create 6 sets of 6 images each, but do not want all sets to be linked. (Running version 2.9.2)