Search This Blog

Friday 17 October 2014

JQuery Colorbox Demo

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<script src="js/jquery-1.8.1.js"></script>
<script src="js/jquery.colorbox.js"></script>
<link rel="stylesheet" href="js/colorbox.css" />
  <SCRIPT LANGUAGE="JavaScript">
  <!--
  $(document).ready(function () {
   jQuery('<div id="close" style="cursor: pointer; position: absolute; top: 0; right: 2px;"><img src="close.png" alt="close"/></div>').appendTo('#contentdiv');
$("#close").click(function() {
            jQuery('#cboxClose').click();
        });

$('#colrboxanchor').click(function () {
$("div#contentdiv").colorbox({
'href':'div#contentdiv',
'top':50,
'left':100,
'inline':true,
'width':400,
'height':400,
'opacity':0.3,
overlayClose:false,
'open':true,
onComplete: function() {
$(this).focus();
},
onClosed:function(){
                    $.colorbox.remove();
                }
});
});
  $('#btn').click(function () {
  alert("1111111111111");
  });
  });

    //-->
  </SCRIPT>
 </HEAD>

 <BODY>
 <div>
<div style="display:none">
<div id="contentdiv">
          <p>div content from request.<br/>welcome to colorbox<br/>It is lightweight jquery box(popup)</br></p>
</div>
</div>
<a  href="#" id="colrboxanchor">Click here to get colorbox popup</a>
<INPUT TYPE="button" id="btn" value="Click"/>
</div>
 </BODY>
</HTML>