弹窗两秒后消失
.Submit {
border-radius: 5px;
background: #80c342;
color: #fff;
margin-left: 50%;
}
.pop_up {
display: none;
width: 150px;
height: 50px;
border: 1px solid #808080;
text-align: center;
line-height: 50px;
border-radius: 5px;
font-size: 16px;
background: #79f00a;
opacity: 0.6;
filter: alpha(opacity=40);
color: #fff;
position: fixed;
top: 14%;
right: 45%;
text-align: center;
}
<button class="Submit">提交</button>
<div class="pop_up">
操作成功
</div>
引入jquery
<script src="./jquery-2.1.0.js"></script>
$('.Submit').click(function () {
$(".pop_up").show();
setTimeout(function () {
$(".pop_up").delay(2000).hide(0);
location.href = "http://baidu.com";
}, 1000);
})
网友评论