<html>
<head>
<style type="text/css">
#loading{
position:fixed;width:200px;z-index:100;left:50%;top:50%;
margin-top:-24px;margin-left:-100px;padding:12px;
background-color:rgba(0,0,0,.8);color:#fff;border-radius:5px;text-align:center
}
</style>
</head>
<body>
<div id="loading" style="display:none"></div>
<a href="http://www.baidu.com" οnclick="#">baidu</a>
<script type="text/javascript" charset="utf-8">
(function () {
var loading = document.getElementById('loading');
window.addEventListener('touchstart click', function(){});
window.addEventListener('pageshow', function () {
loading.style.display = 'none';
});
window.addEventListener('beforeunload', function () {
loading.innerHTML = '正在跳转,请稍候...';
loading.style.display = 'block';
});
})();
</script>
</body>
</html>
<head>
<style type="text/css">
#loading{
position:fixed;width:200px;z-index:100;left:50%;top:50%;
margin-top:-24px;margin-left:-100px;padding:12px;
background-color:rgba(0,0,0,.8);color:#fff;border-radius:5px;text-align:center
}
</style>
</head>
<body>
<div id="loading" style="display:none"></div>
<a href="http://www.baidu.com" οnclick="#">baidu</a>
<script type="text/javascript" charset="utf-8">
(function () {
var loading = document.getElementById('loading');
window.addEventListener('touchstart click', function(){});
window.addEventListener('pageshow', function () {
loading.style.display = 'none';
});
window.addEventListener('beforeunload', function () {
loading.innerHTML = '正在跳转,请稍候...';
loading.style.display = 'block';
});
})();
</script>
</body>
</html>