jquery实现页面加载效果

(编辑:jimmy 日期: 2024/10/1 浏览:2)

1、说明

Jquery页面加载可实现异步请求时提示“请稍后,正在加载...”效果,同步请求不可用(即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页面加载特效</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="/UploadFiles/2021-04-02/jquery.min.js">

jquery实现页面加载效果

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!

一句话新闻

一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?