实现效果
loading=layer.load(1, {
content:"",
shade: [0.7, '#333'],
time:'5000',
success: function(layero,index) {
var i = 5;
var timer = null;
var fn = function() {
// 显示的提示
layero.find(".layui-layer-content").html('正在连接,请稍等('+i+'s)...',);
if (!i) {
layer.close(index);
clearInterval(timer);
}
i--;
};
timer = setInterval(fn, 1000);
fn();
layero.css({'left':'20%','top':"80%"});
layero.find('.layui-layer-content').css({
'padding-top': '10px',
'padding-left': '50px',
'width': '100%',
'font-size':'16px',
'color':'#fff',
});
}
});