Simple jQuery Lightbox Effect Tutorial


Lighbox effect is now an important part of webdesign. It looks good and works in many different kind of situations. Few weeks back, I wrote on creating lightbox effect with CSS only. In this tutorial i am going to show how you can create a lightbox effect with the help of jQury.

See the demo code below. Change content, look and feel and size of the lightbox as per your need

jQuery Lightbox Effect

<script type="text/javascript" src=""></script>
<title>A simple jQuery light box</title>
<style type="text/css">
body {
 margin:200px 0 0 400px;
.lightBox {
width: 300px;
height: 200px;
padding: 20px;
position: absolute;
top: 100px;
background-color: #f2f2f2;
border: solid #606060 2px;
display: none;
z-index: 100;
-moz-border-radius: 15px;
border-radius: 15px;
<script type="text/javascript">
$(function() {
<h2>A simple jQuery light box Demo.. </h2>
<div class="lightBox">
<h3>This is the lightbox content. Change this content to waht you want</h3>
<a href="#" class="close">Close Light Box</a>
<a href="#" class="show">Click Show Light Box</a>

Copy this code and paste it into any HTM file. Run the file in the browser and see the effect.

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Similar Articles


Leave a comment

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.

2020 UseThisTip | Part of Techlomedia Internet Pvt Ltd Developed By Deepanker