仅为尚未订阅的人制作简报弹出窗口

时间:2018-06-13 18:05:22

标签: popup ip hide newsletter

有这个网站:www.sydney-brown.com我想在其上添加一个弹出式时事通讯 - 让它正常工作,但即使在订阅之后它仍然显示。

即使我没有登录,是否可以隐藏它?

    <div class="demo"></div>

<!-- This is the modal -->
<div id="subscribe" class="subscribe uk-modal">
    <div class="uk-modal-dialog uk-text-center">
        <a class="uk-modal-close uk-close" style="color:#000;"></a>

<div class="uk-flex uk-flex-column" style="height:150px;">
    <div>        <p style="font-size: 16px; padding-top:30px;">Sign up for our newsletter<br>
        and get 15% off your first order</p>
</div>
<div class="uk-flex-item-auto"></div>
<div>

                <form action="//sydneybrown.createsend.com/t/j/s/trtkiy/" method="post" id="subForm" class="uk-form">

                <div class="control-group">
                  <div>
                  <p style="font-size: 13px;">For updates and exclusive offers:</p>
</div>
                        <input style="border: 1px solid #000;" id="email" spellcheck="false" name="cm-trtkiy-trtkiy" type="email" placeholder="enter email address" class="input-xlarge"/>
                        <button type="submit" value="Subscribe" class="subscribe-btn uk-button">SUBMIT</button>
                </div>

            <div id="response" style="color:#000;" class="uk-hidden"><br>Thanks! You're subscribed</div>
        </form>
</div>
</div>


  </div>
</div>


<script>
// First Time Visit Processing
// copyright 10th January 2006, Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the below code in this script (including this
// comment) is used without any alteration
function rC(nam) {var tC = document.cookie.split('; '); for (var i = tC.length - 1; i >= 0; i--) {var x = tC[i].split('='); if (nam == x[0]) return unescape(x[1]);} return '~';} function wC(nam,val) {document.cookie = nam + '=' + escape(val);} function lC(nam,pg) {var val = rC(nam); if (val.indexOf('~'+pg+'~') != -1) return false; val += pg + '~'; wC(nam,val); return true;} function firstTime(cN) {return lC('pWrD4jBo',cN);} function thisPage() {var page = location.href.substring(location.href.lastIndexOf('\/')+1); pos = page.indexOf('.');if (pos > -1) {page = page.substr(0,pos);} return page;}

$(function () {




var modal = UIkit.modal(".subscribe", {bgclose: false, center: true});





modal.show();





   if (firstTime(thisPage())) {
        $(window).load(function(){
            modal.show();
        });
   }

    $('#subForm').submit(function (e) {
        e.preventDefault();
        $('.subscribe-btn').fadeTo(200,0.5);
        $.getJSON(
        this.action + "?callback=?",
        $(this).serialize(),
        function (data) {
            $('.subscribe-btn').stop().fadeTo(200,1);
            if (data.Status === 400) { $('#email').addClass('input-xlarge error'); } else { $('#response').show(); modal.hide(); }
        });
    });
});

$j(document).ready(function() {
    if(localStorage.getItem('popState') != 'shown'){
        $j("#popup").delay(2000).fadeIn();
        localStorage.setItem('popState','shown')
    }

    $j('#popup-close, #popup').click(function(e) // You are clicking the close button
    {
        $j('#popup').fadeOut(); // Now the pop up is hiden.
    });
});


</script>

从其他人那里“获得”这个,现在必须找到我的方式。

0 个答案:

没有答案