YoutubeSlanger
Junior Member
- Nov 9, 2011
- 184
- 22
I got a script that is working wonders for me its basically a content lock modified but the problem is I just dont know how to make it show once every 180 days to a visitors, I know I have to cookie it but I just dont know how I spend countless days weeks reading up on it and Im just a idiot I guess, And I like to do everything myself cause I just feel good about doing it lol. But i hit a road block.
this is my JS
How do I cookie this to only show once every 180 days or x amount I want to display.... any help is greatly appreciated
this is my JS
Code:
var Delay = 0;//Seconds after them clicking the link, the gateway vanishes.
var AppearDelay = 35;//Seconds before gateway appears
var oldHistLength = history.length;
var ssDelay = 50;//
var stop_scroll = false;
var oldHistLength = history.length;
setInterval ( "checkHistory()", 100 );
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
function checkHistory() {
if (oldHistLength != history.length)
{
setVisibility('sub3', 'none');
setVisibility('sub4', 'inline');
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');
}
function removegateway()
{
stop_scroll = false;
document.body.style.overflow = ""
$('#gatewaydiv').css('display', 'none');
$('#gatewayDimmer').css('display','none');
}
setTimeout('removegateway()', ssDelay*1000);
$(document).ready(function()
{
$('.offerlink').click(function()
{
setTimeout('removegateway()', Delay*1000);
});
delayappearance();
});
How do I cookie this to only show once every 180 days or x amount I want to display.... any help is greatly appreciated