JSFiddle - React, Tailwind, and code Playground

by hslincoln

HTML

<!-- For use in the template /main/myaccount.html -->

JavaScript

jQuery(document).ready(function () {

    function closeRegister2() { // function to be attached to close icon of second pop
        jQuery(".ow-overlay, .modal").hide("slow"); // Hide first pop
        jQuery.cookie('register2closed', 'yes', { // set cookie to say it's closed
            path: '/',
            domain: 'jmldirect.com'
        });
    }

    if (jQuery("#tvchoicediv2").css("display") === "none") { // check that it's not already displayed
        if (jQuery.cookie('register2closed') === null) { // check it hasn't been closed already cookie doesn't exist
            if (jQuery.cookie('register2') === null) { // check register2 isn't in memory already
                if (jQuery.cookie('register1') !== null) { // check that the first was fired at the beginning of the process
                    jQuery('.ow-overlay, .modal').show(); // Show the second pop 
                        jQuery.cookie('register2', 'popped', { // set cookie to say it's popped
                            path: '/',
                            domain: 'jmldirect.com'
                        }); // End set cookie


                }
            }
        }
    }
}); // End ready