载入动画

<meta charset="utf-8"/>
<div id="loadin">载入中...</div>
<script type="text/javascript">

  <div class="hide" id="shadow" style="width:100%;height:100%;position:fixed;background:#000;opacity:0.5;top:0;left:0;z-index:100;">
    <div id="loadin" style="font-size:30px;text-align:center;position:fixed;z-index:999;color:#fff;width:100%;top:20%">正在验证,请稍等...</div>
  </div>

// <![CDATA[
function easy_loading(id) 
{
    //var symbol = ['-', '\\', '|', '/'], 
    var symbol = ['·', '··', '···', '····'], 
        elem = document.getElementById(id),
        i = 0;
    (function __func() {
        elem.innerHTML = '载入中'+symbol[i++ % 4];
        setTimeout(__func, 200);
    })();
}
easy_loading('loadin');
// ]]>

</script>

 

posted @ 2015-07-28 12:36  壁虎漫步.  阅读(152)  评论(0编辑  收藏  举报