WordPress 美化:弹窗广告代码分享
- 以下代码加到主题的 footer.php </body>的前面
- 自己替换广告图片 URL 为您的图片链接 改成你的链接
- <div id="tmall_1111" style="display:none">
- <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>
- <div style="position: fixed;width: 340px;height: 443px;top: 50%;left: 50%;margin-top: -221.5px;margin-left: -170px;z-index: 1001;">
- <a target="_blank" href="http://wosn.net"><img style="max-height: 100%;max-width: 100%;"
- src="http://wosn.net/logo.png"></a><span
- style="position: absolute;top:-10px;right:-10px;color:#eee;font-size: 30px;cursor: pointer;"
- class="tmall_1111_close"><img
- src="http://wosn.net/logo.png"></span></div>
- </div>
- <div class="tmall_1111_left"
- style="position: fixed; right:4%;bottom: 150px; width: 100px; height: 100px; text-align: center; cursor: pointer; z-index: 99;">
- <img style="max-width:100%;max-height:100%;" src="http://wosn.net/logo.png">
- </div>
- <script type="text/javascript">
- function wp_get_aCookie(a) {
- var b, c, d = document.cookie, e = a + "=";
- if (d) {
- if (c = d.indexOf("; " + e), -1 === c) {
- if (c = d.indexOf(e), 0 !== c) return null
- } else c += 2;
- return b = d.indexOf(";", c), -1 === b && (b = d.length), decodeURIComponent(d.substring(c + e.length, b))
- }
- }
- function wp_set_aCookie(a, b, c, d, e, f) {
- if ("number" == typeof c) {
- var g = c, h = c = new Date;
- h.setTime(+h + 864e5 * g), c = h.toGMTString()
- }
- document.cookie = a + "=" + encodeURIComponent(b) + (c ? "; expires=" + c : "") + (d ? "; path=" + d : " path=/") + (e ? "; domain=" + e : "") + (f ? "; secure" : "")
- }
- function wp_clear_aCookie(a, b, c, d) {
- wp_set_aCookie(a, "", -1, b, c, d)
- }
- jQuery(function (a) {
- 1 != wp_get_aCookie("tmall_1111") && a("#tmall_1111").show(), a(".tmall_1111_close").click(function () {
- a("#tmall_1111").hide(), wp_set_aCookie("tmall_1111", "1", 1 / 24)
- }), a(".tmall_1111_left").click(function () {
- a("#tmall_1111").show()
- })
- });
- </script>
评论