生成加载的图片
loading 样式图标可以从网站定制: loading 样式图标可以从网站定制: https://loading.io/
很多免费的,基本都可以满足需求。
loading设置一个遮盖层
#loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 15000;
}
#loading img {
position: absolute;
top: 50%;
left: 50%;
width: 80px;
height: 80px;
margin-top: -15px;
margin-left: -15px;
}
<div id="loading">
<img src="images/loading.gif">
</div>
$('#loading').hide();
$('#loading').show();
//点击查询按钮重新显示loading
function search() {
$('#loading').show();
$.ajax({
url : "xxx",
type : 'POST',
success : function(data) {
//成功后 隐藏loading框,
$('#loading').hide();
//to do something
},
}
kingEditer编辑器
下载地址:http://kindeditor.net/down.php
那天,我始终没在官方给下载出来,后来还是去https://www.onlinedown.net/soft/88407.htm下载的
简单使用步骤:
<textarea name="content" id="content"></textarea>
<script src="/static/jquery-1.12.4.js"></script>
<script src="/static/plugins/kind-editor/kindeditor-all.js"></script>
<script>
$(function () {
initKindEditor();
});
function initKindEditor() {
var kind = KindEditor.create('#content', {
resize: 0, //禁止文本框横向和纵向拉伸
width: '100%', // 文本框宽度(可以百分比或像素)
height: '300px', // 文本框高度(只能像素)
minWidth: 200, // 最小宽度(数字)
minHeight: 400 // 最小高度(数字)
});
}
</script>