Light box is a really elegant image viewer addon using javascript and the prototype framework. First of all i would like to give the credits to the original maker of Light box,Lokesh Dhakar
I have also added some demos of Lightbox to this page.So if you are not sure,what lightbox is,then take a look at the two demos in this Post.This will really help you in building a well styled gallery like blog.
Installation Steps
1.Login to your Blogger Dashboard
2.Goto Template > Edit HTML
3.Find this piece of code
</head>
and replace it with
<!--Light Box Code Starts Bloggerplugins.ORG--> <style> #lightbox{ position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;} #lightbox img{ width: auto; height: auto;} #lightbox a img{ border: none; } #outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; } #imageContainer{ padding: 10px; } #loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; } #hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; } #imageContainer>#hoverNav{ left: 0;} #hoverNav a{ outline: none;} #prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; } #prevLink { left: 0; float: left;} #nextLink { right: 0; float: right;} #prevLink:hover, #prevLink:visited:hover { background: url(http://lh5.ggpht.com/_u4gySN2ZgqE/SnWk89-4azI/AAAAAAAAAj8/hM0MqnVouCQ/prevlabel%5B3%5D.gif) left 15% no-repeat; } #nextLink:hover, #nextLink:visited:hover { background: url(http://lh6.ggpht.com/_u4gySN2ZgqE/SnWk9-mNiQI/AAAAAAAAAkA/Zg1jXV9xnQM/nextlabel%5B6%5D.gif) right 15% no-repeat; } #imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100% ; } #imageData{ padding:0 10px; color: #666; } #imageData #imageDetails{ width: 70%; float: left; text-align: left; } #imageData #caption{ font-weight: bold; } #imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; } #imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;} #overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; } round-color: #000; } lute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; } round-color: #000; } </style> <script src='http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js' type='text/javascript'/> <script src='http://files.bloggerplugins.org/lbox/js/scriptaculous.js' type='text/javascript'/> <script src='http://blogergadgets.googlecode.com/files/lightbox.js' type='text/javascript'/> <!--Light Box Code Ends Bloggerplugins.ORG--> </head>
Adding Images for the Lightbox Viewer
Now you have added the scripts and styles needed for the lightbox.Next part is to add our images..
You can also add captions to your images and also group multiple images into something like a gallery..
First upload your photo using the blogger photo upload tool.Now switch to the edit html view from the post editor
Now follow the 2 instructions in this image(Click to view a bigger version.. :))
Be sure to delete the -h from s1600-h .Now you should see the light box viewer on your blog.
Options Explained...
adding rel="lightbox" title="Your image Caption" will create a light box viewer for the single image.
Demo of a Single Image
Creating an album with lightbox
If you are planning to add multiple images use rel="lightbox[albumname]" title="Your Image Caption"
now if you want to add another image to this album,upload the second image and use rel="lightbox[albumname]" title="Caption for Second image of albumname" If you do this, lightbox will work like a gallery with next and previous links
Demo of a Light Box Album
Did you notice that your keyboard arrow keys can be used to navigate through the album? :) I hope this would be very useful for those who own a photography blog.If you have any troubles in implementing this,you can surely contact me vis comments or @ Blogger Forums . If you are reading this in a feed reader,the Demos wond be displayed. To see the demos, visit the actual post page @ Light Box Image Viewer For Blogger






I would love to figure this out, but IE keeps aborting your site. I am viewing this on my iPhone.
Hello Aneesh,
Thanks for this great trick :)
But i have certain queries :
1. The image opens in a new window for me. Any problem with coding?
2. How can a visitor save pictures? I could not see any option in this trick and i use free downloadable images on my blog.
Thanks in advance
http://shirdisaibababhajan.blogspot.com/
@Ms Hetal Patil
the imgage opens like in normal post pages because you havent added the rel tag properly.. this is what i see in firefox's view source
rel=”lightbox” title=”© Download Shirdi Sai Baba Bhajans Mp3 Artis”
and this is what i should have seen
rel="lightbox" title="Download Shirdi Sai Baba Bhajans Mp3 Artist";
try eding the post once again.
@Marie Burton ,
i ddin't know that my site had display errors in IE. It works for me in IE8.. I will download IE tester and fix it soon!!
@Ms Hetal Patil,
i forgot to mention something..
its not possible to provide an easy download link.. :(
Hello Aneesh,
Thanks for your instant reply.
hello dear
it is not working on my blog
check this url
http://www.bloggerplugins.org/2009/08/light-box-image-viewer-for-blogger.html
i have done the same
simple work
1. just include style and js files under head section and then
post new using rel attribute
but it is not workin
do u tell me what may be the problem
@The King Khan it working fine on my blog.. you will have to wait until the page is completely loaded.. if you click on the image before that, you will be taken to the normal image link.
if you can show me the url where you tried it,then i can help you out..
dont work in blogger
the problem is with the " , my " is diferent , so what i did is change yours ", and now is working fine, your key pad is diferent to the americans...
whic " did you change?
@vaga
you are right.. i don't know where i got that different " sign.. My keyboard too has the same layout..thanks for notifying!! i have change it..
Thanks for posting this! I've been looking for a better way to present my pictures =) Just curious, though... Is there any way to get the image to open at the top of the page? Or re-size a larger image and the containers to fit on the screen? I tried fiddling with the code but had no luck. I'd greatly appreciate any help you can give! Thanks =)
@K ,
lightbox is a much popular thing and there are sevaral variants of the original lightbox.One of them is lytebox.This one supports automatic resizing and also has slideshow feature,and it can also display a webpage within the lightbox.So i think this one will meet your needs.
and probably my next post would be about lytebox!!
cool
How can i use this + Automatic Post Summaries for Blogger with Thumbnails? Click @ thumbnails and light box open that pic?
Thanks Aneesh!
My friend, thanks for a plug-in..but the plug-in didn't work for me..
http://c905phy.blogspot.com/2009/08/bw-penang-ferry.html
you can view here..
@myfr3ak i don't see any light box code in your template other than the fact that you added rel=lightbox" to the image!!
I really like this lightbox feature, but after pasting the code right where you indicate, and trying to save the changes, I get this:
- Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The element type "html" must be terminated by the matching end-tag "". -
I have very basic (almost inexistent) understanding of HTML, and have no idea how to fix this. :/
@lesser goddess
Contact me via the contact form or @ Blogger Forums. I can help you out. :) or mail me directly at aneesh[at]bloggerplugins.org
I have a scrolling carousel of images at the top of my design and this script interferes with it. I would love to use it, though; if I put it in the correct place, it disables the scrolling carousel. :(
http://neophytephotographer.blogspot.com
@Lynn Thomas
try lytebox. It doesn't normally comflict with other scripts. Read more about it in this forum thread
Hey! Great tip using the Light Box Image Viewer. I have a problem though. For some reason, when I insert the code, it would disable all other javascript features, but the lightbox works. For example, it would disable my glider and tabbed navigation, which are using javascripts. I find this really odd. Hope you can help.
My blog is located at: http://avongenesis.tk
@AvonGenesis,
the other widgets that you mentioned also should be using Jquery.This might have caused conflicts..So if you can't debug it,go for lytebox .You can see a discussion at the forums..
it is not working.
@Aneesh Thanks for the recommendation of using Lytebox instead! Works perfect. One problem though, my images don't seem to have the "close" button when they are being viewed. This isn't a problem since they can easily be closed by clicking outside the image area/pressing escape, but it would be nice to see that button there. Any ideas?
@AvonGenesis,
thats because you didn't edit the css and js file properly.For it to work you have to upload all those images by yourselves and change the image references in the scrip and CSS with the actual urls where you have uploaded them to.. Its explained there in the forum. please read all posts in that topic..
One big issue that I have experienced with this feature is that not showing properly in IE8. When I added the code, lightbox working perfectly on other browsers even IE6 and FF but many of my friends said my blog does not load fully, just 1/3 of homepage in IE8. I immediately remove the code for lightbox, then it works again, please help fix this for IE8
I have edited the .js and .css file with the image links. They were showing before but disappeared suddenly so thats why I left a comment here. Now I have a new problem. Apparently, the lytebox doesn't seem to be working anymore? No settings were changed since they were working properly. I have checked to make sure that they are inserted correctly into my blog and that the .js and .css files are online. Any ideas?
it is not working on templates given by blogger on create a blog.
i have problem with my blog when open it in IE..anyone can solve it??
HI i looking for this for a long time, i tried in my the first to images of my portfolio, but only display the loading image and not the image itself. Can u help me please, love love your blog.
http://www.betancur.co.cc/
Tnx
you might have forgot to remove -h
Great thanks for providing a good widget!
I installed as Light Box Image Viewer for Blogger
It is working with me :) , thanks
http://www.walidlab.com/2009/09/2009_23.html
THANK YOU!!!!!!!THIS IS THE BEST WEBPAGE IVE EVER SEEN, WHICH EXPLAINS HOW TO ADD A LIGHTBOX !!
THANKS A MILLION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
UPDATE DE CODE PLEASE! :)
Nice
http://vinzys.blogspot.com/
Hello admin, this code do not work on IE8, the page can't fully load when this codes are added. please fix this issue. tq
Hello Aneesh, please fix the codes pls, it doesn't work anymore. Please.
I can confirmed this that the code work on IE8, Firefox latest build, and Chrome 4. For easy editing, you can use Windows Live Writer but you need to remove "-h" inside the html code after posting it..
This widget is a great solution for my gallery page. Really thanks to Aneesh for sharing this! I m juz looking around to find something
like this when accidently i found this site and WOWW!!! This site is really amazing,hahaha..it change my profile a lot..thanks again sir Aneesh!
why do multiple images become staggered on the page?
Thank you SO much for this! Just testing it on our newly started company blog now, and will definitely be using this for showing our portfolio of work :)
You can find us at http://www.eggedosis.no - although at the moment we are still just testing stuff ;)
Great page, it was so usefull this is my blog, criaderobsp.blogspot.com check it out ;)
i m follow all the instruction but where i past the
rel="lightbox" title="Your image Caption" this code becoz the code show in image i m not found in my html editor post page i m trying this code in my testing blog so any help
testing blog
http://downloads-nisha.blogspot.com
cool post !
It's a nice plug-in, although I couldn't make the album"version" work. I'll just stick with the single image viewer.
Thank you!
thanks !
hello Aneesh
can u tell me how y make gallry photo sise by side when i m making it shoeing 2nd photo below the first phpoto pls help me
http://esydownloads.blogspot.com
i doning all this work to my testing blog
http://downloads-nisha.blogspot.com
Doesn't work with "Followers" widget. Look :)
Hi there, thanks for your great tutorial, I just have a last question. As you can see on my blog, the pictures and especially the white frame around a pic a hughe. It goes for over the normal screen and you have to scroll down to close the pop up window. What is wrong? Thank you
Andreas
www.photoblog.net.ms
How can I change the size? My pics and the white frame around it are far too big.
It works okay for me on a little testing blog I set up... but when I click on an image, the image that pops up is HUGE. How can I fix this?
Hi thanks for sharing this great widget,I like it very much,
But I notice that it is conflicting with blogger "Followers" widget. I know this because when i remove the script, Follower widget works normally otherwise it just wont show.
Is there a work around to this that I should know.. Thanks
Esta solución ha sido perfecta. Aunque yo utilice "Google Sites" todo siguió igual. Gracias por tu contribución.
"Be sure to delete the -h from s1600-h" --------» Fue Genial!!
The code is not supported by IE ?
Hi,
Thanks for the blogger trick.
This trick has some issues in IE 8. It doesnt work properly. Infact by blog stopped displaying the posts once i added this trick. This works fine in chrome and firefox.
It gives following javascript error:
"HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)."
I guess one of your js file has some issues and doesnt support IE.
Thanks
http://skluvach.blogspot.com/
Great feature and post.
I tried implementing similar feature - AllowFullSize, but ran into some issues. Lightbox works just fine.
http://www.a4aapl.com
This worked perfectly. I was banging my head for days until I stumbled on this. Kudios to you!
Hi guys I am so thick I cannot understand what I am doing wrong. I have been trying to get this to work for couple of days, the more I look the more confused I get can you help please thank you
John Large
We were unable to save your template
Please correct the error below and submit your template again.
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
XML error message: The element type "html" must be terminated by the matching end-tag "".
I will apply this for my new blog. Thanks!
Did you find a fix for the 'followers widget' conflict? I really like the lightbox, but I want my followers on my page too.
Hello,
I've a problem, I'm trying your code but I'm getting the Lightbox "popup" blank without any image loaded :S The a>href is OK.
IE throws a JS error : parsing error unable to modify the parent container element before the child element is closed (KB927917)
What can I do ?
Thanks
HI!
How is it possible to put pictures one near eachother in a grid like shape and not one under another like in a usual post? I would like to put more pictures in a post but not to display them in a column but it 2 or 3 .. you have an example right here at the "Demo of a Light Box Album"
Hi Aneesh,
Is there any bugs and known issues with this script?
Hi Aneesh,
How to add Slideshow feature?
How can this work with "followers widget"?
@buythecow - can you show me the url where it conflicts with the followers gadget?
and my followers list also disapears from below the posts.
@Aneesh - http://stickynoise.blogspot.com
Thanks Aneesh!!
This works great!
I just have to change the size of my images,... but finally it works!
Take a look @ http://vtepperspics.blogspot.com/2010/03/water.html
Love it !, thanks aneesh! is ther any chance i can deactivate the arrows utility for "prev" and "next" by modifying the script? I rather have the arrows to scroll horizontally for wider images and only have the "prev" & "next" functionality by hovering ....
Thank you very much Aneesh. It works perfectly in my blog. Thanks for your effort. May god give you the best in your life ;)
Hi Anesh. I found that IE8 failed to open my blog. Other browsers seems ok. This is my blog : www.akupunyacerite.blogspot.com
Any idea how to fix this? Your help is highly appreciated
As Astromas said, it dont work with IE, but working good with firefox and still some of the widjets not working like follows, other posts etc.
Can you please guide me.
Thanks in advance
great, thank you very much!
but can i use images uploaded from picasa?
This works beautifully, took my slow brain a while to figure out where to insert the code but even I managed it, thank you
lightbox is not working please visit this blog and see the problem www.yourjavascript.com
@Aneesh - how can the followers widget work properly with the lightbox also?
Works perfect, BUT, when I add this to my blog, My Followers Gadget disappears completly!!!
Is there any solution for this problem?
http://www.braulioguido.blogspot.com/
Seriously, I LOVED IT! This is just the thing I was looking for. Thanks a lot for this great trick. You made my day. :)
When I add it to my blog, the slider stops! take a look! http://ihecker.blogspot.com
Is there way to add lightbox while slider is still moving? Thanks!
Hi Folks,
I added the line rel="lightbox" title="Your image Caption" on the place described in this blog: http://soumyadipc.blogspot.com/2008/02/blogger-hack-make-original-images-open.html
Advantage: you don't have to delete onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" in your <a href code
It works well, see my blog: http://aboveoeuf.blogspot.com/
Can It Work For Other Image Upload Services Like Photostock, Tiny image, Help
It does't Work For other service please relpy.
Mobilesstore.Tk
How can I change a text? Like "Image X of X", "Next", "Prev"? I want to change on my native language.
Amazing!!!! thank you so much for doing this! I've been looking for it for ages!
Just wanted to share what I have noticed. after publishing my photos I have noticed that they don't pop up, whole screen goes black but nothing pops up. I could also see part of html code above few photos. I have edited my post & published it again and again- about 5 times whithout making any changes, and problem fixed itself. I have to do the same thing with everysingle post.
after this lightbox is working as it should, but I have only one question? is there any way photos can pop up in smaller size? smaller that the original version saved on my PC? or would I have to resize my images or change the quality?
thank you once again for a great job you have done!
How can I insert .swf and video (youtube, vimeo) files?
Thanks a lot!!
my site: http://carlos-march.blogspot.com/
This is amazing. I'm having problems with my followers widget thought. Can we do something abut it?
I use this simple "lightbox" {http://esmussdoch.blogspot.com/2008/08/lightbox-einbauen.html}and have no problems with my "followers widget"
Watch my blog: http://aboveoeuf.blogspot.com/
I totally love your work. Thx for all of your efforts :)
Hello, thanks for this tutorial, the plugin works good except for the number of photos in an album it displays. Like for example (http://babydesertwolf.blogspot.com/2010/07/lightbox-for-blogger.html), I have 20 pictures in an album but it displays 40.
can you tell me what's the problem?
Hi there. I did it! Now I'd like to adjust the size so that I don't have to scroll down to see the whole image. Please advise.
Got it working fine but can't seem to display album images in a grid like you have, I can only display them in one column like someone above. Any tips?
Great Post! It was easy for me to understand and implement on my blog. My next question is, can I have one image shown on the blog to launch a lightbox gallery for several images? I just want one picture in my blog post, but I want that one picture to launch the lightbox gallery for multiple images. Can this be done?
Thanks,
-GravoNH
Thank you very mach:D
Thanks so much for the great tutorial! I'm trying to use the "read more" tag to truncate my Blogger post. This way the blog doesn't have to load all the images in the post, just the first one (and saving room on the page).
So far, when the post is truncated, Light Box only acknowledges the first image. I have to click "read more" and show the whole post in order for Light Box to acknowledge all the pictures. Please tell me there's a way around this. Thanks!
@Ancient Squid Media - no there is no way around. Light box displays only those images that are present on the current page. The images present after the read more tag will not be there in the page and so wont come in the lightbox overlay.
This works OK for me in IE, but not in FireFox? Why is that? The first time I tried the lightbox, it worked well in both. Now, the page goes dark, but no lightbox appears in Firefox. Please advise.
URL: http://gravograph.blogspot.com
after i pasted this code, my follower been missing..
it shows nothing under my follower tab.
how to fix this???
Thanks for the info mate. I wanted to host my own scripts and that made this post quite redundant. But as your post does not claim to teach that, that is no fault of yours.
Your 'explanation', however, on adding albums was brief to the point of being senseless. It often surprises me how those whom are good at the logic behind a programme are rubbish when it comes to cross applying it in simple communication - comprehensive, concise, and systematic ought to be kept in mind when it comes to instructions. I suppose your 'cut and paste' post would be helpful for those wanting a quick fix, but unless the scripts hold, it would be a temporary one.
thanks! this is awesome! :)
CAN YOU ADD VIDEOS????
This code is really awesome . Its working fine on my blogger post. http://gamedit.blogspot.com. Thanks a lot
can i make the pics smaller and when people click on the pics they are normal size??
is there any box like this which opens websits in it :D
me too marie ... I would love to figure this out, but IE keeps aborting your site. I am viewing this on my iPhone. i try ( image viewer ) program that is eay to use and powerful on site: ( Sharewarepile.com )
I dint understood how to do that because my image as /s1600/ like this,,,
error XML: The element type "html" must be terminated by the matching end-tag "".
Thats a really great widget. Thank you for sharing
I love this! Thanks for the explanation!
@Pong Cruz - you have replaced <head> instead of </head>. Also you haven't copied the complete code. fix those :)
Hello Aneesh, once I upload an image I is not onblur = try ........
or-h
how is it possible to repair this?
Thank you for your help
Hello Aneesh, I really love this site it is by far one of the best! I did everything that you said & still I have a problem. You can try this individual page & see
http://www.rafaholics.com/2010/08/kids-day-at-open.html
Post a Comment
Please don't spam on here..