Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a time before showing a popup #28

Open
HartLarsson opened this issue Nov 7, 2017 · 0 comments
Open

Set a time before showing a popup #28

HartLarsson opened this issue Nov 7, 2017 · 0 comments

Comments

@HartLarsson
Copy link

I've tried this solution:

            var popup = new $.Popup();
            if ($.cookie('responsive_popup') == null) {
                var myVar = setTimeout(function(){ popup.open('#inline'); }, 3000);
                
            }
            $(".popup_close").click(function(){
                clearTimeout(myVar);
                $.cookie('responsive_popup', 'yes', { expires: {/literal}{$popup_cookie*0.000694}{literal}, path: '/' });
            });

The onkly problem is when i click the X to close the popup with setTimeout used, the cookie is not saved. If i remove the setTimeout function and return to the normal way is working.

Is very strange! There is a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant