第一次打开网站点击任意跳转指定网址
起首 设置一个div层 以及css
<div id="firstMask" style="display: none;"></div>
<style type="text/css">
html,body {
height: 一00%;
position: relative;
}
#firstMask {
width: 一00%;
height: 一00%;
position: fixed;
display: none;
top: 0;
left: 0;
z-index: 九 九 九 九;
cursor: pointer;
background-color: transparent;
}
</style>
js代码
<script>
$(document).ready(function() {
if(!window.name) {
//console.log("第一次挨谢");
window.name = "yuttname" ;
$("#firstMask").show(); // + 新删
$('#firstMask').click(function () {
$("#firstMask").hide()
if(location.href.indexOf('www.isiyuan.net') !==⑴){
window.open("http://www.百度.com");//第一次挨谢时设置name
}else{
window.open("http://www.百度.com");//第一次挨谢时设置name
}
localStorage.clear(); //浑全体 徐存
});
} else { // 没有是第一次挨谢 将 遮罩来失落
$("#firstMask").hide()
}
});
</script>