项目演示页面,在点击按钮后响应较慢,为了增进体验效果,先弹出窗口提示,等响应返回后修改提示内容。
弹窗内容自定义:
layer.msg('<span id="confirm" style="font-size:25px;position: relative;top:70px;">发送中......</span>', {icon:1,area:['260px','200px']});
发送请求:
$.ajax({ type: 'post', url: "/monitor/demos/testDemos", data: {}, dataType: 'json', success: function (result) { if (result.flag ==true) { $("#confirm").text("场景模拟成功"); setTimeout(function () { layer.closeAll(); }, 6000); } } });