为了能正常显示demo,网友需要先去下载layer.js,加载到html中
<!DOCTYPE HTML><html>
<meta charset="UTF-8" />
<head>
<title></title>
</head>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="layer-v3.0.3/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function() {
$('.btn').click(function() {
layer.msg('加载中(点击关闭)', {
icon: 16,
shade: 0.5, //遮罩层透明度
shadeClose: true, //点击遮罩层关闭
time: 0, //不自动关闭
}, function() {
layer.alert('显示加载信息后,你可以执行别的 *** 作,就像这样', {
skin: 'layui-layer-lan',
closeBtn: 0,
anim:6 //动画类型
})
})
})
})
</script>
<style type="text/css">
html,
body {
margin: 0
padding: 0
}
.demo {}
</style>
<body>
<div class="demo">
<button class="btn">点击显示效果</button>
</div>
</body>
</html>
首先,你要在<head>中引入jquery的js,
然后
<div id="main" style="width:90%"><table class="table table-bordered table-striped table-condensed" style="width:100%">
<tr>
<th>Name</th>
<th>PastDue</th>
<th>Advanced</th>
<th>AboutOf</th>
<th>Exceed</th>
<th>sldd</th>
</tr>
<div class="loading">
<img src="loading.gif">
</div>
<tbody class="pybody" style="display: none">
<tr py:for="bug in mail_settings">
<td>${bug.pastDoName}</td>
<td>${bug.pastDue}</td>
<td>${bug.advanced}</td>
<td>${bug.aboutOf}</td>
<td>${bug.exceed}</td>
<td>${bug.sldd}</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
$('.pybody').ready(function(){
$(".loading").fadeOut()
$(".pybody").fadeIn()
})
</script>
以上代码可以直接复制粘贴
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)