开发者

jQuery .cookie with .delay?

I am trying to set a cookie with a delayed amount of time.

开发者_运维问答

I want the cookie to be set after 80 minutes on the page.

here is my code -

$(document).ready(function() {
            // Set the cookie after 81 mins so the next visit has the button
            $.cookie('EVGSalesLetter', 'visited').delay(4860000); 
        });


.delay() is for the animation queue, to just generally set a timer use setTimeout(), like this:

setTimeout(function() { $.cookie('EVGSalesLetter', 'visited'); }, 4860000);

I didn't stick this in a document.ready because I'm assuming (hopefully safely...) that ater 81 minutes your page has fully loaded :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜