1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[help]need script in looks like

Discussion in 'HTML & JavaScript' started by maxthon, Dec 21, 2009.

  1. maxthon

    maxthon Newbie

    Sep 15, 2009
    Likes Received:
    hi i'm need script before we entering website we have click some ads before entering
    Last edited: Dec 22, 2009
  2. inviz

    inviz Newbie

    Jun 15, 2010
    Likes Received:
    Something quick i came up with

    <!DOCTYPE html>
    <html lang="en">
    		<meta charset="utf-8" />
    		<meta http-equiv="X-UA-Compatible" content="IE=edge; chrome=1" />
    		<title>Lock content</title>
    		<style type="text/css">
    			* {
    				margin: 0px;
    				padding: 0px;
    			#locker {
    				display: none;
    				height: 250px;
    				width: 400px;
    				display: none;
    				padding: 5px;
    				background-color: #eeffee;
    			#locker ul {
    				margin-left: 30px;
    			#overlay {
    				background: rgba(0,0,0,0.3);
    				display: none;
    				width: 100%;
    				height: 100%;
    				position: absolute;
    				top: 0;
    				left: 0;
    				z-index: 99998;
    		<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    		<script src="http://code.jquery.com/jquery-migrate-1.1.0.min.js"></script>
    		<script type="text/javascript">
    			jQuery.fn.center = function() {
    				this.css("position", "absolute");
    				this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px");
    				this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
    				return this;
    			$(document).ready(function() {
    				$('#locker').show().center().css('z-index', '99999');
    				$('#locker a').click(function() {
    				<h1>Content Locker test</h1>
    				Site content...
    			<div id="locker">
    				This is the content locker
    						<a href="#">Link 1</a>
    						<a href="#">Link 2</a>
    						<a href="#">Link 3</a>
    		<div id="overlay"></div>
    Just change the contents of <div id="locker"> </div> to suit your needs.. You have to edit the script a little, if your ads isnt regular links (e.g. javascript)..