Add a Custom jQuery Lightbox To Blogger

If you are not satisfied with the default Lightbox set up by Blogger, here's another amazing way to show off your pictures. If you've missed out, I have already shown in one of my posts how to customize the Blogger Lightbox by changing the background color, borders or the text color, but this tutorial will show you how to replace it entirely with a cool jQuery Lightbox plugin that is very popular among bloggers.

What this Lightbox does, is to display larger versions of the images that will pop-up into a larger box once we click on them, and allows us to easily navigate through that set of photos by using the previous and next buttons.

jquery lightbox, blogger plugins

To see it in action, please visit the following demo blog and click on any picture to enlarge it.


Adding jQuery Lightbox to Blogger

Step 1. From your Blogger Dashboard, click on Template > Edit HTML

blogger edit html

Step 2. Click anywhere on the code area and press the CTRL + F keys to open the search box. Paste the following tag inside the search box and hit Enter to find it:
]]></b:skin>
Step 3. Choose one of the Lighbox styles from below and paste the CSS code just above the aforementioned ]]></b:skin> tag:

Custom Blogger Lightbox with White Background


jquery lightbox white
#jquery-overlay{position:absolute;top:0;left:0;z-index:90;width:100%;height:500px;}
#jquery-lightbox{position:absolute;top:10%;left:0;width:100%;z-index:100;text-align:center;line-height:0;}
#jquery-lightbox a,#jquery-lightbox a:hover{border:none;}
#jquery-lightbox a img{border:none;}
#lightbox-container-image-box{position:relative;background-color:#fff;max-width: 960px;max-height: 560px;margin:0 auto;}
#lightbox-container-image{padding:10px;}
img#lightbox-image {max-height: 540px;max-width: 940px;}
#lightbox-loading{position:absolute;top:40%;left:0%;height:25%;width:100%;text-align:center;line-height:0;}
#lightbox-nav{position:absolute;top:0;left:0;height:100%;width: 100%;z-index:10;}
#lightbox-container-image-box > #lightbox-nav{left:0;}
#lightbox-nav a{outline:none;}
#lightbox-nav-btnPrev,#lightbox-nav-btnNext{width:49%;height:100%;zoom:1;display:block;}
#lightbox-nav-btnPrev{left:10%;float:left;}
#lightbox-nav-btnNext{right:10%;float:right;}
#lightbox-container-image-data-box{font:10px Verdana,Helvetica,sans-serif;background-color:#fff;margin:0 auto;line-height:1.4em;overflow:auto;max-width: 940px;;padding:0 10px 0;}
#lightbox-container-image-data{padding:0 10px;color:#555;}
#lightbox-container-image-data #lightbox-image-details{width:70%;float:left;text-align:left;}
#lightbox-image-details-caption{font-weight:bold;}
#lightbox-image-details-currentNumber{display:block;clear:left;padding-bottom:1.0em;}
#lightbox-secNav-btnClose{width:66px;float:right;padding-bottom:0.7em;}

Custom Blogger Lightbox with Dark Background:


jquery lightbox dark
#jquery-overlay{position:absolute;top:0;left:0;z-index:90;width:100%;height:500px;}
#jquery-lightbox{position:absolute;top:10%;left:0;width:100%;z-index:100;text-align:center;line-height:0}
#jquery-lightbox a,#jquery-lightbox a:hover{border:none}
#jquery-lightbox a img{border:none;}
#lightbox-container-image-box{position:relative;background-color:#000;max-width: 960px;max-height: 560px;margin:0 auto}
#lightbox-container-image{padding:10px;}
img#lightbox-image {max-height: 540px;max-width: 940px;}
#lightbox-loading{position:absolute;top:40%;left:0%;height:25%;width:100%;text-align:center;line-height:0}
#lightbox-nav{position:absolute;top:0;left:0;height:100%;width: 100%;z-index:10}
#lightbox-container-image-box > #lightbox-nav{left:0;}
#lightbox-nav a{outline:none}
#lightbox-nav-btnPrev,#lightbox-nav-btnNext{width:49%;height:100%;zoom:1;display:block}
#lightbox-nav-btnPrev{left:10%;float:left}
#lightbox-nav-btnNext{right:10%;float:right}
#lightbox-container-image-data-box{font:10px Verdana,Helvetica,sans-serif;background-color:#000;margin:0 auto;line-height:1.4em;overflow:auto;max-width: 940px;;padding:0 10px 0}
#lightbox-container-image-data{padding:0 10px;color:#fff}
#lightbox-container-image-data #lightbox-image-details{width:70%;float:left;text-align:left}
#lightbox-image-details-caption{font-weight:bold}
#lightbox-image-details-currentNumber{display:block;clear:left;padding-bottom:1.0em}
#lightbox-secNav-btnClose{width:66px;float:right;padding-bottom:0.7em}
Step 4. Now find the following tag and just above it, add the below scripts:
</head>

Script for Lightbox with White Background:

   <script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
    <script src='http://helplogger.googlecode.com/svn/trunk/custom-lightbox-for-blogger.js' type='text/javascript'/>

Script for Lightbox with Dark Background:

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
    <script src='http://helplogger.googlecode.com/svn/trunk/custom-lightbox-for-blogger-black.js' type='text/javascript'/>
Step 5. Click on the "Save template" button to save the changes.

Finally, we need to disable the original Blogger Lightbox so that it doesn't interfere with this one that we just added: go to "Settings" > "Posts and comments" and on the right side, you will see the "Showcase images with Lightbox" section > select "No" and click on the "Save settings" button on the upper right side.

disable blogger lightbox

Now, view your blog and click on any image to see this Custom Blogger Lightbox in action. Enjoy!

Comments/disqusion
14 comments

  1. says:

    Nice

  2. says:

    Hi bro!

    Its been long time I've been waiting for this trick. Even I had tried so many tricks same like to change or add the Light Box effect to the post images

    Unfortunately this one also not worked on my blog I followed all the step you mentioned above but don't know why its not working on my this blog... please when ever you saw my comment please tell me what else should I need to add Light Box Effect on my blog. I'll waiting for your kind response :)

    Here its my blog!

    http://wallpapers-download-hd.blogspot.com/

  3. says:

    Thanks dude, it was a cool lightbox. But there is a little annoying thing. If we press the next/prev button then close it. It only close the recent pic, we must press close again to close the lightbox. Can it be fixed? Sorry for my bad English.

  4. says:

    help me its not working please share some other lightbox with next previous button on images

  5. says:

    nice blog.. very clean.. :)

  6. says:

    Hello, any ideas how to add caption to your lightbox?

  7. says:

    Hello light box works perfectly, but because of it my slider is not working. can you help me with that ?
    i'll be very thankful to you.

  8. says:

    Or just tell me if for some particular picture i dont want to use light box how can i do that ?

  9. says:

    Hi! I can't find the " ]]>". I press enter after pasting it to the Find command but nothing happens! Can you help me?

  10. says:

    I want specific widths photo when enlarged.... Because.. using effect lightbox.. Photos launched very big... Demo: http://vi-pikapika.blogspot.com/2014/07/tuyen-cong-tac-vien-cho-website-nam-2014.html
    I want fix...please guide me fix... How do to define length and width magnification of the image???

  11. says:

    Awesome Post sharing is always good for new comer thanks again Admin here is my one http://badhanpbn.blogspot.com

  12. says:

    Hi! I followed the instructions that you have presented above and I disabled the original blogger's lightbox but the images pop up in a new window - I mean that your lightbox does not work in chrome in my blog
    http://newcaredentist.blogspot.gr/2014/10/blog-post_3.html. In firefox the images pop up as a lightbox but their size remains the same, as in the original blogger's lightbox, without any close or next-previous buttons.
    Could you give me a piece of advice of how to resolve this or why should that happen? Thank you!

  13. says:

    Thank you. :-) This worked really well for me on Blogger. However, can you advise me of how to remove the "Close X" box from the script?

  14. says:

    Thank You so much. This worked great on a new template that didn't for whatever reason have lightbox. Thax again.