Created
April 9, 2015 10:39
-
-
Save fourroses666/243d04e351b26465e886 to your computer and use it in GitHub Desktop.
popup js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookie_popup = (function() { | |
var date = new Date(); | |
var minutes = 5; | |
date.setTime(date.getTime() + (minutes * 60 * 1000)); | |
if ($.cookie('cookie_popup') == undefined) { | |
$('.cookie-popup-wrap').fadeIn(600); | |
$.cookie('cookie_popup',true,{ expires: date }); | |
}; | |
$('#closepopup').click(function (e) { | |
e.preventDefault(); | |
$('.cookie-popup-wrap').fadeOut(600); | |
}); | |
}); | |
setTimeout(function() { | |
cookie_popup(); | |
}, 2000); | |
$(window).scroll(function(){ | |
if($(this).scrollTop() > 100){ | |
cookie_popup(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment