Friday 16 August 2013

HOW TO MAKE SIMPLE LIGHTBOX

In this example I am going to explain how a light box can be created without JQUERY or any other such extensions.




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LIGHT BOX</title>
    <script type="text/javascript">
    function test()
    {
     
    light.style.display ="inline-block";
    }

    function hide()
    {
    light.style.display="none";
    }
    </script>
</head>
<body>

<a onclick="test()"><img src="tulips.jpg" alt="image not found" width="146" height="118" align="middle" /></a>
     

<div id="light" onclick="hide()" style="display:none;background-color: #000000; opacity:.9;text-align: center; background-position: center; top: 0px; right: 0px; bottom: 0px; left: 0px; position: absolute; z-index: 2;">
<img src="
tulips.jpg" />

 </div>

</body>
</html>





Even though I use HTML here, you can covert it into any other programming language.





0 comments:

Post a Comment