.mask{
height: 100%;
width: 100%;
background: #000;
position: absolute;
top: 0;
left: 0;
opacity: 0.5;/*火狐、谷歌*/
filter: alpha(opacity=50);/*ie*/
display: none;
}
.searchTip{
width: 1220px;
height: 800px;
position: absolute;
top: 0;
left: 50%;
margin-left: -580px;
display: none;
}
.searchTip div{
position: absolute;
display: none;
}
.searchTip div a{
position: absolute;
/*隐藏文字*/
text-indent: -999px;
overflow: hidden;
cursor: pointer;
}
.searchTip div span{
position: absolute;
text-indent: -999px;
overflow: hidden;
cursor: pointer;
height: 30px;
width: 30px;
}
.stepA{
width: 800px;
height: 518px;
background: url(image/stepA_1.png) no-repeat;
left: 16px;
top: 109px;
}
.stepA a{
top: 150px;
left: 470px;
width: 80px;
height: 65px;
}
.stepA span{
left: 95px;
top: 88px;
}
.stepB{
width: 800px;
height: 352px;
background: url(image/stepB_1.png);
top: 275px;
left: 5px;
}
.stepB a{
top: 110px;
left: 590px;
width: 100px;
height: 65px;
}
.stepB span{
left: 320px;
top: 66px;
}
.stepC{
width: 800px;
height: 321px;
background: url(image/stepC_1.png);
top: 315px;
left: 0;
}
.stepC a{
top: 180px;
left: 500px;
width: 70px;
height: 50px;
}
.stepC span{
top: 148px;
left: 298px;
}
.stepD{
width: 800px;
height: 540px;
background: url(image/stepD_1.png);
top: 156px;
left: 5px;
}
.stepD a{
top: 320px;
left: 600px;
width: 105px;
height: 60px;
}
.stepD span{
top: 253px;
left: 262px;
}
.stepE{
width: 800px;
height: 488px;
background: url(image/stepE_1.png);
top: 157px;
left: 418px;
}
.stepE a{
top: 275px;
left: 440px;
width: 100px;
height: 60px;
}
.stepE span{
left: 94px;
top: 200px;
}
<script>
window.onload=function(){
var oMask=document.getElementById('mask');
var oSearch=document.getElementById('searchTip');
var aStep=oSearch.getElementsByTagName('div');
var aA=oSearch.getElementsByTagName('a');
var aClose=oSearch.getElementsByTagName('span');
//读取cookie
var res=document.cookie.substring(5);
alert(res);
//如果没有cookie,执行以下动作
if(res!="www.open.com.cn"){
alert(res);
//mask 父框 第一单元显示出来
oMask.style.display=oSearch.style.display=aStep[0].style.display="block";
for(var i=0; i<aStep.length; i++){
aA[i].index=i;//为每一个按钮增加一个index属性,为后面引用的
aA[i].onclick=function(){
this.parentNode.style.display="none";
if(this.index < aStep.length-1){
aStep[this.index+1].style.display="block";
}
else if(this.index==aStep.length-1){
oMask.style.display=oSearch.style.display="none";
}
}
}
//关闭按钮
for(var i=0; i<aClose.length; i++){
aClose[i].onclick=function(){
oMask.style.display=oSearch.style.display="none";
}
}
//添加cookie
var oDate=new Date();
oDate.setDate(oDate.getDate()+30);//30天后失效
document.cookie="name=www.open.com.cn;expires="+oDate;
}
}
</script>