移动端居中弹出广告代码 带关闭带遮罩

移动端居中弹出广告代码  带关闭带遮罩

js代码如下

<script type="text/javascript">
    var shuangshiyiurl = "https://s.click.taobao.com/yGznzxv";
    var expired = "2";
    if(getCookie("shuangshiyi")!=null && getCookie("shuangshiyi")=="1"){
    }else{
        $('body').after('<div id="shuangshiyi"><div style="background: radial-gradient(rgba(0, 0, 0, 0.498), rgba(0, 0, 0, 0.8)); width: 100%; height: 100%; z-index: 1000; top: 0px; left: 0px; position: fixed; opacity: 0.8; transition: all 0.3s;" id="bkg_tm"></div>' +
            '    <div id="tm_qg" style="position: fixed; width: 100%; height: auto; top: 50%; left: 50%; margin-top: -80%; margin-left: -40%; z-index: 1001;">' +
            '        <a href="'+shuangshiyiurl+'" target="_blank">' +
            '            <img src="{DT_MOB}static/img/11pc.png" style="max-height: 80%;max-width: 80%;"></a>' +
            '        <span style="position: absolute;bottom:-35px;right:56%;color:#eee;font-size: 30px;cursor: pointer;" class="qmm-cll" onclick="close11()">' +
            '            <img style="width:30px" src="{DT_MOB}static/img/1111close.png" onclick="close11()">' +
            '        </span>' +
            '    </div></div>');
        setZhaopincookie();
    }
    function setZhaopincookie(){
        var d=new Date();
        d.setTime(d.getTime()+expired*60*60*1000);
        document.cookie="shuangshiyi=1;expires="+d.toGMTString();
        var res=document.cookie;
        return res;
    }
    function getCookie(c_name)
    {
        if (document.cookie.length>0)
        {
            c_start=document.cookie.indexOf(c_name + "=")
            if (c_start!=-1)
            {
                c_start=c_start + c_name.length+1
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
            }
        }
        return ""
    }
    function close11() {
        $('#shuangshiyi').remove();
    }
</script>
每日壁纸

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注