该教程纯属娱乐,无任何实际作用哈,就是博主觉得很有意思额。
当访客离开我们网站页面时,变换其原来的浏览器标签,可吸引用户继续点击浏览,哈哈,你懂的。
教程很简单,将下面的 js 放入 footer 即可。教程完毕!
<script>
window.onload = function() {
function c() {
document.title = document[a] ? "草榴技术讨论區欢迎您," + str + "好 !": d
}
hour = (new Date).getHours(),
str = "",
str = 6 > hour ? "凌晨": 9 > hour ? "早上": 12 > hour ? "上午": 14 > hour ? "中午": 17 > hour ? "下午": 19 > hour ? "傍晚": 22 > hour ? "晚上": "夜里",
a = document.title,
b = document.title,
d = document.title,
"undefined" != typeof document.hidden ? (a = "hidden", b = "visibilitychange") : "undefined" != typeof document.mozHidden ? (a = "mozHidden", b = "mozvisibilitychange") : "undefined" != typeof document.webkitHidden && (a = "webkitHidden", b = "webkitvisibilitychange"),
"undefined" == typeof document.addEventListener && "undefined" == typeof document[a] || document.addEventListener(b, c, !1)
};
</script>