<!DOCTYPE html>
<html lang="en">
<head>
< charset="UTF-8">
< > </ >
< charset="utf-8" href="css/reset.css" rel="external nofollow" rel="stylesheet">
< charset="utf-8" href="css/main.css" rel="external nofollow" rel="stylesheet">
<style>
.box{width:200px;height:200px;background:#000000;}
.xxloading{width:100%;height:100%;background:rgba(255,255,255,0.2);}
.xxloading .xximg{width:100%;height:100%;background:url("../img/ico/loading2.gif") no-repeat center;}
</style>
< src="js/jquery-1.8.3.min.js"></ >
< src="js/mychajian.js"></ > <!-- 添加jq的loading插件-->
</head>
<body>
<div class="box"></div>
< >
$(function () {
$(".box").myloading(); //执行loading动画
});
</ >
</body>
</html>
mychajian.js的插件内容:
;(function($){
$.fn.extend({
myloading:function(obj){
var str=[" <div class=\"xxloading\">",
" <div class=\"xximg\"></div>",
" </div>"].join("");
return this.append(str);
}
});
})(jQuery);
效果图显示:

继续阅读与本文标签相同的文章
下一篇 :
分析python请求数据
-
Mybatis一二级缓存实现原理与使用指南
2026-05-18栏目: 教程
-
那些 BAT 的面试官,都是怎样面试 iOS开发者的?
2026-05-18栏目: 教程
-
SpringCloud微服务(01):Eureka组件,服务注册与发现
2026-05-18栏目: 教程
-
SpringCloud微服务(02):Ribbon和Feign组件,服务调用和负载均衡
2026-05-18栏目: 教程
-
Remax - 使用真正的 React 构建小程序
2026-05-18栏目: 教程
