WordPress 美化:弹窗广告代码分享

沃森博客 2018年9月26日00:15:48WordPress评论550阅读模式

WordPress 美化:弹窗广告代码分享

WordPress 美化:弹窗广告代码分享

  1. 以下代码加到主题的 footer.php </body>的前面
  2. 自己替换广告图片 URL 为您的图片链接 改成你的链接
  3. <div id="tmall_1111" style="display:none">
  4.     <div style="width: 100%; height: 100%; z-index: 1000; top: 0px; left: 0px; position: fixed; opacity: 0.8; transition: all 0.3s; background: radial-gradient(rgba(0, 0, 0, 0.498039), rgba(0, 0, 0, 0.8));"></div>
  5.     <div style="position: fixed;width: 340px;height: 443px;top: 50%;left: 50%;margin-top: -221.5px;margin-left: -170px;z-index: 1001;">
  6.         <a target="_blank" href="http://wosn.net"><img style="max-height: 100%;max-width: 100%;"
  7.                                                                     src="http://wosn.net/logo.png"></a><span
  8.                 style="position: absolute;top:-10px;right:-10px;color:#eee;font-size: 30px;cursor: pointer;"
  9.                 class="tmall_1111_close"><img
  10.                     src="http://wosn.net/logo.png"></span></div>
  11. </div>
  12. <div class="tmall_1111_left"
  13.      style="position: fixed; right:4%;bottom: 150px; width: 100px; height: 100px; text-align: center; cursor: pointer; z-index: 99;">
  14.     <img style="max-width:100%;max-height:100%;" src="http://wosn.net/logo.png">
  15. </div>
  16. <script type="text/javascript">
  17.     function wp_get_aCookie(a) {
  18.         var b, c, d = document.cookie, e = a + "=";
  19.         if (d) {
  20.             if (c = d.indexOf("; " + e), -1 === c) {
  21.                 if (c = d.indexOf(e), 0 !== c) return null
  22.             } else c += 2;
  23.             return b = d.indexOf(";", c), -1 === b && (b = d.length), decodeURIComponent(d.substring(c + e.length, b))
  24.         }
  25.     }
  26.     function wp_set_aCookie(a, b, c, d, e, f) {
  27.         if ("number" == typeof c) {
  28.             var g = c, h = c = new Date;
  29.             h.setTime(+h + 864e5 * g), c = h.toGMTString()
  30.         }
  31.         document.cookie = a + "=" + encodeURIComponent(b) + (c ? "; expires=" + c : "") + (d ? "; path=" + d : " path=/") + (e ? "; domain=" + e : "") + (f ? "; secure" : "")
  32.     }
  33.     function wp_clear_aCookie(a, b, c, d) {
  34.         wp_set_aCookie(a, "", -1, b, c, d)
  35.     }
  36.     jQuery(function (a) {
  37.         1 != wp_get_aCookie("tmall_1111") && a("#tmall_1111").show(), a(".tmall_1111_close").click(function () {
  38.             a("#tmall_1111").hide(), wp_set_aCookie("tmall_1111""1", 1 / 24)
  39.         }), a(".tmall_1111_left").click(function () {
  40.             a("#tmall_1111").show()
  41.         })
  42.     });
  43. </script>

 

 

 

沃森博客
  • 本文由 发表于 2018年9月26日00:15:48
  • 本文来自互利网收集整理,问题反馈联系邮箱:wosnnet@foxmail.com,转载请务必保留本文链接:https://wosn.net/1425.html

发表评论