需求:
有时加载数据比较慢,页面一直没有反应,用户也许会不停的刷,而且用户体验也不好
解决:
在js中加入以下代码即可
//提示信息 function addrunningp() { $(<p class=\"datagrid-mask\"></p>).css({ display: block, width: 100%, height: $(document).height() }).appendto(body); $(<p class=\"datagrid-mask-msg\"></p>).html(正在处理,请耐心等待...).appendto(body).css({ display: block, left: ($(document.body).outerwidth(true) - 190) / 2, top: ($(document).height() - 45) / 2 }); } //取消提示信息 function moverunningp() { $(p[class='datagrid-mask']).remove(); $(p[class='datagrid-mask-msg']).remove(); }
在需要的地方调用即可。
效果如下:整个页面不可编辑
相信看了本文案例你已经掌握了方法,更多精彩请关注其它相关文章!
推荐阅读:
css3的pointer-events使用详解
伪元素::before与::after使用详解
以上就是css制作“正在加载”提示框的详细内容。
