簡單的layer.open彈出輸入框樣式
阿新 • • 發佈:2019-02-16
js程式碼
效果layer.open({ id:1, type: 1, title:'修改密碼', skin:'layui-layer-rim', area:['450px', 'auto'], content: ' <div class="row" style="width: 420px; margin-left:7px; margin-top:10px;">' +'<div class="col-sm-12">' +'<div class="input-group">' +'<span class="input-group-addon"> 新 密 碼 :</span>' +'<input id="firstpwd" type="password" class="form-control" placeholder="請輸入密碼">' +'</div>' +'</div>' +'<div class="col-sm-12" style="margin-top: 10px">' +'<div class="input-group">' +'<span class="input-group-addon">確認密碼:</span>' +'<input id="secondpwd" type="password" class="form-control" placeholder="請再輸入一次密碼">' +'</div>' +'</div>' +'</div>' , btn:['儲存','取消'], btn1: function (index,layero) { }, btn2:function (index,layero) { layer.close(index); } });
注:將layer層設定成固定大小時,有時儲存和取消按鈕會顯示在layer層區域外,如果想要按鈕正常顯示,可將layer層中area屬性中的高度設定為auto