Lightbox 2 WordPress Plugin
2142 giorni faWordPress plugin used to overlay images on the current page into neat Javascript-powered overlay popups.
16-12-2008 – Version 2 is out! Now from settings you can choose background-color, overlay opacity, resize speed and automatically add the lightbox effect to your post’s images.
This plugin includes the new Lightbox JS v2.0.4 javascript written by Lokesh Dhakar and and was then transformed into a WordPress Plugin by me. Use a title attribute if you want to show a caption. Click on the images below for an example.
- 29-07-2007 – See also the new Slimbox WordPress Plugin, a 7kb clone of the popular Lightbox JS
- I added the digg it button, please DIGG ME!
Upgrade
- De-activate the plugin.
- Delete the old version `lightbox-2-wordpress-plugin` directory.
Installation
- Unzip the `lightbox-2-wordpress-plugin.zip` file.
- Upload lightbox-2-wordpress-plugin folder to the /wp-content/plugins/ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress, go to Setting->Lightbox.
- Add a rel=”lightbox” attribute to any link tag to activate the lightbox, or rel=”lightbox[roadtrip]“ for an image set.
- Optional: Use a
titleattribute if you want to show a caption.
Single example:
<a href=”img1.jpg” rel=”lightbox” title=”my caption”>thumbnail1</a>
Image set example:
<a href=”img1.jpg” rel=”lightbox[roadtrip]“>thumbnail1</a>
<a href=”img2.jpg” rel=”lightbox[roadtrip]“>thumbnail2</a>
<a href=”img3.jpg” rel=”lightbox[roadtrip]“>thumbnail3</a>
Tnx to my sister for the photos! Link me in your site!
Changelog
Version 2.0.2 (19-12-2008)
Some fixes
Version 2.0 (16-12-2008)
Background-color, overlay opacity, resize speed, auto-lightbox from settings.
Version 1.8.2 (09-06-2008)
Some fixes
Version 1.8 (14-03-2008)
Update Lightbox Js to version 2.04
- v2.04 – 03/09/08
- NEW – Upgraded Prototype from v1.4 to v1.6.0.2
- NEW – Moved label text into configuration for easier localization
- UPDATED – Code cleaned up. Respect for the global namespace and native javascript objects.
- FIXED – Caption displays as “null” when viewing an uncaptioned image after viewing a captioned image.
- FIXED – Clicking ‘close’ button shifts layout as link focus’ dotted line appears.
Version 1.7 (12-06-2007)
Update Lightbox Js to version 2.03.3
- v2.03.3 – 5/21/07 – Support for horizontally scrolling pages. Added updateImageList method for ajax’y pages.
Fixed xhtml validation
Version 1.6 (05-05-2007)
Update Lightbox Js to version 2.03.2
- v2.03.2 – 4/30/07 – Fixed animated gif support in IE/Opera.
- v2.03.1 – 4/18/07 – Fixed embed hiding. Overlay opacity var added to config. Image sets w/Imagemaps fix. Clearfix removed.
- v2.03 – 4/10/07 – Improved keyboard navigation. Animation off toggle. HidesFlash movies under overlay. Imagemap support. Valid CSS.
Fixed close and loading vars (Tnx to Anton Zhuchkov)
Changed “get_settings(‘home’)” in “get_option(‘siteurl’)”
(Tnx to Luca Dentella)
Version 1.5 (06-05-2006)
Fixed close and loading vars.(see here if u have problem with close button)
Version 1.4
Fixed path’s problem
Update Lightbox Js to version 2.0.2
Centering in IE6 (any DOCTYPE) fixed.
Smoothed out resize transition.
Fixed layout issues caused by multiline captions.
Added keyboard navigation: N for next, P for previous and X for close.
Version 0.3
Single Images and Image Set
My plugin on wordpress page suddenly stopped working. I wrote several email to them but nothing…

If you appreciate this plugin or my support, please donate to me so I can but a cup of coffee. Thank you!

Thanks to the donors:
- Per T Sovik
- Hoa Hua
- Spencer Harris
- Jan Herrmann
- Niels Emmer
- Sahar Alarayedh
[...] Lightbox 2 写真をカッコ良く開いてくれます。 これを入れるだけで、カッコ良くなります。 Downloadサイトへ [...]
cozi:
Hi,
I’m trying to get this great plug in for my site and followed the steps exactly. However I can’t get the lightbox working and opens a new window for all images. You can try the linked imgs from
http://www.arkyacht.com/?page_id=134 .
I see the js firing when loading the page but the rest is not functioning. Any chance this is due to new version of WordPress 2.8.6 I’m using?
Thanks in advance!
Joseph
Pablo:
For anyone having problems with Lightbox, using WP 2.8.6 and have followed all steps correctly, on a previous post I found the solution thanks to Stuart. here it is!!! Simple!
I had the same problem. I activated version 2.0.2 of the plugin on my WordPress 2.8.5 blog, and it didn’t work, even though I had images with the rel=”lightbox” attribute set.
I looked at the HTML code for my webpage, and saw that the Lighbox JavaScript files were not being included in my header.
Inspecting the source code for the plugin (in /plugins/lightbox-2-wordpress-plugin/lighbox.php), I found the following line of code:
$lightboxoffmeta = get_post_meta($post->ID,’lightboxoff’,true);
if ($lightboxoffmeta == “false”) {
echo ‘ lb_path = “‘ . $lightboxpluginpath . ‘lightbox/”; lb_opacity= “‘ . $lightboxlb_opacity . ‘”; lb_resize= “‘ . $lightboxlb_resize . ‘”;’.”\n”;
echo ”.”\n”;
echo ”.”\n”;
echo ”.”\n”;
echo ”.”\n”;
echo ‘#overlay {background-color:’ . $lightboxcolor1 . ‘;}’.”\n”;
}
The plugin seems to be looking for post metadata (lightboxoff=false) before it will write the JavaScript to the header.
I changed the line of code to:
if ($lightboxoffmeta == “”) {
…and now it works fine.
[...] Lightbox 2 – Generates thumbnails that when clicked load in a lightbox. [...]
Pablo:
Hi! Thanks for the plugin. Im using it on WP 2.8.6, but im having problems. I selected the plugin to work on all pages of my website (home, categories, posts, archive, etc…) put it just wont on posts and pages!
I tried to modify the code, but i didn’t really undestand it. What can i do? I just want it to work everywhere!
[...] Lightbox 2 WordPress Plugin 画像をライトボックスで表示 [...]
[...] まずLightbox 2 WordPress Pluginをダウンロード [...]
Kolya:
The automatic lightboxing is broken with this plugin as well as with Slimbox.
John:
Hey, nice post.
Thanks for the interesting info.
[...] Lightbox 2 WordPress Pluginを入れてみた [...]
Amjo: there is a new based Lightbox Plugin what works like you want
Francesco:
Ciao
Sto provando ad installare il plugin per l’utilizzo della lightbox nelle gallerie di wordpress, ma il javaScript va in errore al momento del caricamento della pagina. L’errrore sembra relativo alla gestione degli eventi nel file prototpe.js. Potrebbe essere un problema relativo a conflitti con altri script (tipo mootools per la gestione di un menu) o tubepress?
[...] [...]
[...] [...]
[...] 25 © Lightbox2 Sitenizdeki resimlerin Lightbox efekti ile gösterimini sağlar. Link [...]
[...] Traq – 生成博客的统计信息,以图形显示。Sociable – 添加漂亮的网摘按钮。LightBox 2 – [...]
[...] Lightbox 2 :灰盒子插件,用幻灯效果显示图片,很酷。 [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox JS Plugin – 为当页图片使用全新JS脚本的浏览方式,非常漂亮。 [...]
[...] 25 © Lightbox2 Sitenizdeki resimlerin Lightbox efekti ile gösterimini sağlar. Link [...]
[...] 24 © Lightbox2 Sitenizdeki resimlerin Lightbox efekti ile gösterimini sağlar. Link [...]
[...] Lightbox 2. – lightbox eklentisi [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
Liz:
I am having problems with the light box. If you go to the following page link:
http://www.rhinorubystudios.com/pricing-plans/themes/
and click on that screen shot image a window pops up, but does not show the image I linked to but instead shows the theme template of my website!?!
I appreciate your assistance with this.
Thank you! Grazie!
Liz
[...] 1.Lightbox2Wordpress Plugin [...]
[...] Lightbox 2 (5/48) . Have you seen a neat trick on some websites, where you press on the image, the whole page dims into the background and the active window or image pops-up to the front? If you don’t know what I’m talking about, just head to the plugin page and press on the images there. If you want such a trick on your blog, install the plugin. [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox 2 – Generates thumbnails that when clicked load in a lightbox. [...]
Alex:
Hi! I’m having issues getting this plugin to work as well. On the homepage it doesn’t seem to work at all. When enabled and I go to a single-post page, it leaves a big black box at the top of the screen, and then the lightbox doesn’t even display correctly (box far too big for the image, buttons not loading, etc.).
For now I’ve just disabled the plugin but I’d love to know how I could get this work! I’m using Google Chrome for Mac, for what it’s worth. Also, I’ve tried Stuart’s fix, but all that does is leave a big black box on my homepage, with the same problems I’m currently having on single-post pages.
Thanks in advance for your help.
-Alex
Alex:
Fixed my problem! It was a conflict with a google maps plugin. Thank you so much!
Alex:
You fixed my problem! It was a conflict with a google maps plugin. Thank you so much!
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox 2 [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
thanks a lot for nice plugin mister, this is the best
[...] Lightbox 2:灰盒子插件,用幻灯效果显示图片,很酷。 [...]
[...] Lightbox JS Plugin – used to overlay images on the current page into neat Javascript-powered overlay popups. http://www.4mj.it/lightbox-js-v20-wordpress/ [...]
My Vimeo-videos is getting over the layer. How do i fix this?
GREAT plugin mate!
[...] Lightbox JS Plugin – Usado para exibir imagens maiores na mesma página usando Javascript overlay popups. [...]
[...] Lightbox JS Plugin – thường dùng để tạo một popup cho các ảnh trong bài viết giúp ảnh hiển thị chi tiết và rõ hơn. [...]
[...] Lightbox JS Plugin – Usado para exibir imagens maiores na mesma página usando Javascript overlay popups. [...]
[...] Lightbox 2 – Generates thumbnails that when clicked load in a lightbox. [...]
Erik:
Hello…great plug-in! Noticed an issue: can set functionality in every section EXCEPT “Older Entries”. Works fine on the home page, but if I go to the second page of listings, the plug-in does not work.
Thanks,
ERik
[...] Sites – 当读者通过搜索引擎找到博客时,自动显示该关键词相关的日志。 Lightbox JS Plugin – 为当页图片使用全新JS脚本的浏览方式,非常漂亮。 NAVT – [...]
[...] – 生成博客的统计信息,以图形显示。 Sociable – 添加漂亮的网摘按钮。 LightBox 2 – 当你点一个图片时,其他部分变淡、突出显示全图。非常漂亮的效果。 [...]
[...] Sites – 当读者通过搜索引擎找到博客时,自动显示该关键词相关的日志。 Lightbox JS Plugin – 为当页图片使用全新JS脚本的浏览方式,非常漂亮。 NAVT - [...]














[...] Allez une petite carte pour tester le plugin lightbox-2 [...]