javascript svg 页面 loading

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>loading</title>
	<link rel="stylesheet" href="http://at.alicdn.com/t/font_1452229253_7439058.css">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<style>#loading{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);color:#fff;text-align:center;z-index:10000}#loading .space{height:30%}#loading h1{height:60px;color:#20d42d;text-align:center;padding-bottom:20px}#loading h1 img{width:60px}#loading p{text-align:center;color:#1ac14d;font-size:1.16em}</style>
</head>
<body>
	<div id="loading"><div class="space"></div><h1><img src="static/images/loading.svg"></h1><p>数据加载中</p></div>
	
	<script>
            var loading = document.getElementById('loading'); 
            document.onreadystatechange = function () { 
                if (document.readyState == "complete") {
                    loading.remove();}
            }
        </script>
	
	
</body>
</html>
posted @ 2016-02-26 18:11  陈朔  阅读(351)  评论(0编辑  收藏  举报