a页面代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>a</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
<script src="http://static.qumingdashi.com/newqiming/js/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
*{margin:0;padding:0;}
</style>
</head>
<body>
aaaaaaaaaa
<a href="b.html">点击</a>
</body>
</html>
去往b页面
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>b</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
<script src="http://static.qumingdashi.com/newqiming/js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEventListener("popstate", function(){
if(window.listState){
window.location.href='c.html'
}else{
window.history.go(-1)
}
}, false)
</script>
<style type="text/css">
*{margin:0;padding:0;}
</style>
</head>
<body>
bbbbbbbbbbb
<script type="text/javascript">
function openNavigation(){
if(!window.history.state){
window.history.pushState({listState:"package"}, "","");
}
window.listState=true;
}
openNavigation();
</script>
</body>
</html>
去往C页面
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>c</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
<script src="http://static.qumingdashi.com/newqiming/js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEventListener("popstate", function(){
if(window.listState){
$('.div').addClass('show')
openNavigation1();
window.listState=false;
}else{
if(window.listState1){
window.location.href='b.html?query='+Math.floor(Math.random()*100+1);
}
}
}, false)
</script>
<style type="text/css">
*{margin:0;padding:0;}
.div{ position: fixed; left: 0; right: 0; top: 0; bottom: 0; visibility:hidden; color:#fff; text-align: center;}
.div:after{ content:''; background: #000; opacity: .7; z-index: -1; position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.div.show{ visibility: visible; }
</style>
</head>
<body>
ccccccccccc
<div class="div">我是二维码层</div>
<script type="text/javascript">
function openNavigation(){
if(!window.history.state){
window.history.pushState({listState:"package"}, "","");
}
window.listState=true;
}
openNavigation();
function openNavigation1(){
if(!window.history.state){
window.history.pushState({listState1:"package"}, "","");
}
window.listState1=true;
}
</script>
</body>
</html>
最终在bc页面之间跳转