Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery modal on pageload disappearing because of age verification overlay
    primarykey
    data
    text
    <p>Wasn't sure of the best way to word the title but here's the gist of it: I made an ecommerce site for a client a couple months ago, it's marijuana related merch, so they wanted an age verification. I made that with a javascript overlay. Now they want a disclaimer to launch after age verification and before the homepage.</p> <p>I made a jquery modal that fires on pageload with a cookie so it doesn't pop up every time you go to the home page. Unfortunately the cookie registers when the age verification loads, so when you submit your age, the cookie is registered and the disclaimer is gone before you get a chance to see it.</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function(){ var check_cookie = $.cookie('ss_manifesto'); if(check_cookie == null){ $.cookie('ss_manifesto', '1', { expires: 7 }); $("#ModalMessage").dialog({modal: true}); } }); &lt;/script&gt; </code></pre> <p>Is there a way to edit the <code>check_cookie</code> to be <code>null | 1</code> or something, and then make the value to be +1 on each load? That way it has to get to a value of 2 before the disclaimer is removed?</p> <p>EDIT: </p> <p>I added this hoping to set the cookie on clicking to exit modal but it's not setting anything. </p> <pre><code> $(document).ready(function(){ var check_cookie = $.cookie('ss_manifesto'); if(check_cookie == null){ $("#ModalMessage").dialog({modal: true}); } $('.ui-dialog-titlebar-close').click(function(){ $.cookie('ss_manifesto', '1', { expires: 7 }) }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload