CodePen

HTML

            
              <html>
  <header>
    <script type="text/javascript" src="jquery/jquery.js"></script>
	<script type="text/javascript" src="jquery/ease.js"></script>
	<script type="text/javascript" src="jquery/ease2.js"></script>
	<script type="text/javascript" src="jquery/color_animation.js"></script>
	<script type="text/javascript" src="jquery/datagridview.js"></script>
	<link rel="stylesheet" type="text/css" href="css/blackbox.css">
  </header>
  <body>
    <div>
      <div>
        <a href="#"> <h1>click me to show you sth </a></h1>
      </div>
    <div>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

 
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
      </div>
    </div>
  </body>
</html>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .blackbox{

	width:100%;
	height: 100%;
	position:absolute;
	z-index:9999;
	opacity:0;
	top:0px;
	margin-left:-8px;
}

.close_container{

	border-radius:1px;
	width:20px;
	height:40px;
	background-color:#f0f0f0;
	position:absolute;
	z-index:10000;
	top:-40px;
	right:30px;
	box-shadow:0px 0px 5px 0px rgba(42,42,42,.5);
}

.close_container #close_btn {

	cursor:pointer;
	position:absolute;
	z-index:10000;
	top:50%;
	left:0%;
	color:#232323;
	padding:0px 4px 0px 4px;
}

.rotate{

	-webkit-transform:rotate(90deg);
	-webkit-transition: all 0.2s ease-out;
	-moz-transform:rotate(90deg);
	-moz-transition: all 0.2s ease-out;
	-o-transform:rotate(90deg);
	-o-transition:all 0.2s ease-out;
}

.rotate_back {

	-webkit-transform:rotate(0deg);
	-webkit-transition: all 0.2s ease-out;
	-moz-transform:rotate(0deg);
	-moz-transition: all 0.2s ease-out;
	-o-transform:rotate(0deg);
	-o-transition:all 0.2s ease-out;
}

.center_box{

	opacity:0;
	max-width:700px;
	z-index:10000;
	border:7px solid #cecece;
	background-color:#f0f0f0;
	left:0px;
	position:absolute;
	padding:7px;
	top:100px;
	font-family:B homa;
	box-shadow:0px 0px 10px 1px #181818;
	font-size:13px;
	text-align:right;
}

.center_box #header{

	margin:0px;
	text-align:right;
	font-size:15px;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
$(document).ready(function(){

	(function($){

		$.fn.lightbox = function(header,content,options){

			var defaults = {
			blackboxBackground:"black",
			color:"black",
			animationTime:"300",
			animationType:"expoout",
			opacity:'.6',
			fontFamily:"B homa",
			direction:'rtl',
			textAlign:'right'
			}


			var settings = $.extend(defaults,options);
			$(this).each(function(){
				// if settings are true do this 
				if(content != "[object object]" && header !=  "[object object]"){
					$('body').append("<div class='blackbox' style='background-color:"+settings.blackboxBackground+"'></div>").append("<div class='center_box' style='direction:"+settings.direction+";text-align:"+settings.textAlign+" '><div id='header'>"+header+"</div><hr/>"+content+"</div>").append("<div class='close_container'><div id='close_btn'><p style='margin:0px'>✕</p></div></div>");
					showblackbox();
				}

			});
			
			


			function showblackbox(){

				$('.blackbox').stop().animate({opacity:'.6'},settings.animationTime,settings.animationType);
				$('.center_box').stop().delay(200).animate({opacity:'1',left:Getcenterpos('.center_box')},300,'expoout');
				$('.close_container').stop().delay(500).animate({"top":"-10px"},300,'expoout');
			}



			$('.close_container #close_btn').mouseover(function(){
					
				$('.close_container #close_btn p').addClass("rotate")//
				$(this).stop().animate({backgroundColor:"#787878",color:"#f0f0f0"},300,'expoout');
				$('.close_container #close_btn p').removeClass("rotate_back");
			}).mouseout(function(){

				$('.close_container #close_btn p').removeClass("rotate");
				$('.close_container #close_btn p').addClass("rotate_back");
				$(this).stop().animate({backgroundColor:"#f0f0f0",color:"#131313"},300,'expoout');
			}).click(function(){

				$('.close_container').animate({top:"-50px"});
				$('.center_box').stop().delay(300).animate({opacity:'0',left:"-200px"},300,'expoout',function(){$(this).css("display","none");});
				$('.blackbox').stop().delay(500).animate({opacity:"0"},300,'expoout',function(){$(this).css("display","none");});
			});
      
			function Getcenterpos(element){

				var window_width = $(window).width() ;
				var element_widh = $(element).width();
				var pos = (window_width/2) - (element_widh/2)-15;
				return pos;
			}
		
		}
	})($)
	


	$('a').click(function(){
		var content = "It would look funny if I didn't put a bunch of text in here, so I'm typing nonsense. That's right, if you're reading this then you're just reading nonesense, or if you're on the other side of The Big Pond, then I might be inclined to say that you're reading poppycock.";
		$('body').lightbox("The title of the form",content,{direction:"ltr",textAlign:"left"});
	});

});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................