Random content locking script

Status
Not open for further replies.

TheVegan

Junior Member
Joined
Mar 6, 2013
Messages
179
Reaction score
33
Heres a random content locking script I found on my computer :)
it shows a lock on your page and wont close until user clicks one of the links

JAVASCRIPT
Code:
 var Delay = 2;//Seconds after clicking the link, the gateway vanishes. 
    var AppearDelay = 0;//Seconds before gateway appears
    var oldHistLength = history.length;
    var stop_scroll = false;
    var once_per_session=1;
    var unknown=true;
     
     
    //don't edit anything past this line
    function setcookie() {
    if (unknown==false){
    document.cookie="alerted=yes"
    }
    }  
     
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
    offset += search.length
    // set index of beginning of value
    end = document.cookie.indexOf(";", offset);
    // set index of end of cookie value
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
   }
   }
    return returnvalue;
   }
 
    function alertornot(){
    if (get_cookie('alerted')==''){
    loadalert();
 
   }
   }
 
    function loadalert(){
    delayappearance();
   }
 
    if (once_per_session==0)
    loadalert()
    else
    alertornot()
 
     
     
    setInterval ( "checkHistory()", 20000 );
 
     
    function checkHistory()
    {
   if (oldHistLength != history.length)
   {
   removegateway();
   oldHistLength = history.length;
   }
   }
     
     
     
    function scrolltop(){
    if(stop_scroll==true){
        scroll(0,0);
    }
    }
     
     
     
    function delayappearance()
    {
        setTimeout("setupgateway()", AppearDelay*1000);
         
    }
 
     
    function setupgateway()
     
    {
        stop_scroll = true;
        window.scrollTo(0,0);
        document.body.style.overflow = "hidden"
        var Left = $(window).width() /2;
        Left = Left - $('#gatewaydiv').width()/2;
         
        var Top = $(window).height() /2;
        Top = Top - $('#gatewaydiv').height()/2;
         
        $('#gatewaydiv').css('top', Top+'px').css('left', Left+'px').css('display', 'inline');
        $('#gatewayDimmer').width($('html').width());
        $('#gatewayDimmer').height($('html').height());
        $('#gatewayDimmer').css('display','block');
        setTimeout("setcookie()", AppearDelay*6000);
         
 
    }
     
    function removegateway()
    {
        stop_scroll = false;
        document.body.style.overflow = ""
        $('#gatewaydiv').css('display', 'none');
        $('#gatewayDimmer').css('display','none');
    }
     
    $(document).ready(function()
    {
        $('.offerlink').click(function()
        {
            setTimeout('removegateway()', Delay*1000);
        });
         
    });

CSS

Code:
    gatewaybody
    {
         
         
        height:100%;
        margin:0;
    }
 
    #gatewaymainContent
    {
        background-color:white;
        margin-left:auto;
        margin-right:auto;
        margin-top:30px;
        width:700px;
        border:3px solid #CDCDCD;
        text-align:center;
    }
 
    #gatewaydiv
    {
        width:406px;
        height:255px;
        padding:10px;
        position:absolute;
        display:none;
        background-color:#FFFFFF;
        border:solid 4px gray;
        text-align:center;
        font-family:arial;
    }
 
    #gatewaydiv h1
    {
        font-size:35px;
        color:#228B22;
    }
 
        #gatewaydiv h2
    {
        font-size:25px;
        color:#000000;
    }
 
    #gatewayMessage
    {
        font-size:18px;
    }
     
    .offerlink
    {
        color:red;
        font-weight:bold;
    }
     
    #OfferList
    {
        margin:0;
        padding:0;
    }
     
    #OfferList
    {
        list-style:none;
    }
 
    #gatewayDimmer
    {
        background-color:#000000;
        opacity:0.8;
        display:none;
        position:absolute;
        top:0;
    }


HTML

Code:
<div id="gatewayDimmer">
</div>
 
<div id="gatewaydiv">
    <ul id="OfferList">
    <h1>Please Click Below to ENTER!</h1>
    <span id="gatewayMessage"><!-- Message --></span>
    <br /><br />
        <li><a href="http://www.google.com" class="offerlink" target="_blank"></a></li>
    <li><a href="http://www.yahoo.com" class="offerlink" target="_blank"></a></li>
        <li><a href="http://www.bing.com" class="offerlink" target="_blank"></a></li>
    </ul>
    <br /><br />
    Thankyou !
     
</div>
 
Status
Not open for further replies.
Back
Top