html5 新手引导插件,实现“新手引导”效果

效果:

d38dbc5c9d44a11de5af8bd3b8544e1d.png

e8f31ae74f6ee642dce9875007151b40.png

e20558b3a5c70425d681117d422ee497.png

61f22d6122efc94738a681a74a557ded.png

代码:

*{margin: 0;padding: 0;}

.main-div{background:url(imgs/gz.jpg);background-size: cover;height: 800px}

#mask{height: 100%;width: 100%;position: absolute;top: 0;left: 0;background:#000;opacity: 0.5;filter:alpha(opacity=50);display: none;}

#searchtip{width: 1400px;height: 800px;background:transparent;position: absolute;left: 50%;margin-left: -700px;display: none;}

#searchtip div{position: absolute;display: none;}

#searchtip div a{position: absolute;width: 50px;height: 30px;background:rgb(32, 137, 152);cursor: pointer;text-align: center;line-height: 32px;top: 0px;left: 0px;text-decoration: none;color: #fff;font-size: 12px;}

#searchtip div span{position: absolute;width: 30px;height: 30px;background:rgb(32, 137, 152);cursor: pointer;text-align: center;line-height: 30px;top: 0px;left: 170px;color: #fff;border-radius: 50%;}

.stepa{width: 200px;height: 135px;background:url(imgs/hand.jpg);left: 330px;}

.stepb{width: 200px;height: 135px;background:url(imgs/hand2.jpg);left: 970px;top: 90px}

.stepc{width: 200px;height: 135px;background:url(imgs/hand3.jpg);left: 620px;top: 580px}

window. () {

//读取cookie

var localcookies = document.cookie.substring(5);

if (localcookies != "xinshouyindao") {

var mask = document.getElementById("mask"),

searchtip = document.getElementById("searchtip"),

step = searchtip.getElementsByTagName("div"),

aobj = searchtip.getElementsByTagName("a"),

spanobj = searchtip.getElementsByTagName("span");

mask.style.display = searchtip.style.display = step[0].style.display = "block";

//下一步

for (var i = 0; i < step.length; i++) {

aobj[i].index = i;

aobj[i].οnclick=function(){

this.parentNode.style.display = "none";

if (this.index < step.length-1) {

step[this.index+1].style.display = "block";

}else if(this.index == step.length-1){

mask.style.display = searchtip.style.display = "none";

}

}

};

//关闭按钮

for (var i = 0; i < spanobj.length; i++) {

spanobj[i].onclick = function(){

mask.style.display = searchtip.style.display = "none";

}

};

//cookie存储

var date = new Date();

date.setDate(date.getDate()+30);

document.cookie = "name=xinshouyindao;expires="+date;

}

}

c31030a5516232ec2445d7db04c5de00.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值