Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Do anyone know how to combine these 2 javascript together ? which is setTimeout function for modal window and cookie function for modal window . I'm new in javascript don't know how to write these 2 function together , wish someone to help out .I had set "TimerOut" function for modal window after page loaded and display .On the other side , I set cookie for it too ,I just need modal window display in once .Now the TimerOut function was overlapping the cookie function . Thanks in advance ! here my code

Modal window settimerout function :
<script type="text/javascript">
var show = function(){

    var timer = window.setTimeout(show,3000);

Modal window with cookie function :

        offset: {
          top: 10
    if ($.cookie('pop') == null) {
                $.cookie('pop', '7');

$(function($) {
$('#deleteCookie').click(function() {
        $.cookie('pop', null);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900