最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery實(shí)現(xiàn)頁(yè)面加載效果

 更新時(shí)間:2017年02月21日 14:34:51   作者:冷戰(zhàn)  
本文主要介紹了jquery實(shí)現(xiàn)頁(yè)面加載效果的實(shí)例,具有很好的參考價(jià)值,下面跟著小編一起來(lái)看下吧

1、說(shuō)明

Jquery頁(yè)面加載可實(shí)現(xiàn)異步請(qǐng)求時(shí)提示“請(qǐng)稍后,正在加載...”效果,同步請(qǐng)求不可用(即ajax async: false)。

2、代碼

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>jquery頁(yè)面加載特效</title>
 <style type="text/css">
 *
 {
  margin: 0;
  padding: 0;
  list-style-type: none;
 }
 a, img
 {
  border: 0;
 }
 .loading
 {
  margin: 100px auto 0 auto;
  width: 400px;
  text-align: center;
  font-size: 18px;
 }
 .loading .action
 {
  text-decoration: none;
  font-family: "微軟雅黑" , "宋體";
 }
 .cover
 {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 998;
  width: 100%;
  height: 100%;
  _padding: 0 20px 0 0;
  background: #f6f4f5;
  display: none;
 }
 .showLoad
 {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 9999;
  opacity: 0;
  filter: alpha(opacity=0);
  margin-left: -80px;
 }
 *html, *html body
 {
  background-image: url(about:blank);
  background-attachment: fixed;
 }
 *html .showLoad, *html .cover
 {
  position: absolute;
  top: expression(eval(document.documentElement.scrollTop));
 }
 #ajaxLoad
 {
  border: 1px solid #8CBEDA;
  font-size: 12px;
  font-weight: bold;
 }
 #ajaxLoad div.loadAll
 {
  width: 180px;
  height: 50px;
  line-height: 50px;
  border: 2px solid #D6E7F2;
  background: #fff;
 }
 #ajaxLoad img
 {
  margin: 10px 15px;
  float: left;
  display: inline;
 }
 </style>
 <script type="text/javascript" src="js/jquery.min.js"></script>
 <script type="text/javascript">
 $(function () {
  var hei = $(document).height();
  $(".cover").css({ "height": hei });
  $(".action").click(function () {
  startWaiting();
  setTimeout(function () {
   endWaiting();
  }, 3000);
  });
 });
 //開(kāi)始加載
 function startWaiting() {
  $(".cover").css({ 'display': 'block', 'opacity': '0.8' });
  $(".showLoad").stop(true).animate({ 'margin-top': '300px', 'opacity': '1' }, 200);
 }
 //結(jié)束加載
 function endWaiting() {
  $(".showLoad").stop(true).animate({ 'margin-top': '250px', 'opacity': '0' }, 400);
  $(".cover").css({ 'display': 'none', 'opacity': '0' });
 }
 </script>
</head>
<body>
 <div class="loading">
 <a class="action" href="javascript:void(0);" rel="external nofollow" >點(diǎn)擊加載特效</a></div>
 <div class="cover">
 </div>
 <div id="ajaxLoad" class="showLoad">
 <div class="loadAll">
  <img src="image/waiting.gif">加載中,請(qǐng)稍候...</div>
 </div>
</body>
</html>

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

最新評(píng)論

砀山县| 潜山县| 宁海县| 屏东县| 阿鲁科尔沁旗| 图们市| 文成县| 新巴尔虎左旗| 镇宁| 平遥县| 罗田县| 彭山县| 呼和浩特市| 连南| 盈江县| 西乡县| 五河县| 浠水县| 成都市| 故城县| 景德镇市| 东乡族自治县| 沾益县| 巴青县| 甘肃省| 无锡市| 龙泉市| 长丰县| 邢台县| 阳西县| 雷山县| 运城市| 肇源县| 法库县| 内黄县| 南召县| 襄樊市| 新兴县| 当涂县| 老河口市| 周口市|