layer open div 注意事项

1、要弹窗的div,一般需要隐藏,隐藏必须加 display:none;

比如

<div  style="display:none;" id="settingXiangou_show_div">
        <div class="dialog-form clearfix" >
            <div class="form-group ">
                <label class="label-inline fl" for=""><span class="red">*</span>限购:</label>
                <div class="col-sm-4">
                    <ul class="list-unstyled mb-0">

                        <li class="d-inline-block " id="xiangou_num_type">
                            <select class="form-control  " id="max_buy_count_type" name="max_buy_count_type">
                                <option value="0" >不限购</option>
                                <option value="1" >每天</option>
                                <option value="2" >每周</option>
                                <option value="3" >每月</option>
                                <option value="4">每年</option>
                                <option value="5">永久</option>
                            </select>
                        </li>
                        <li class="d-inline-block hide" id="xiangou_num">

                            <div class="input-group  input-group-sm w120">
                                <input class="form-control input-sm  inline"  id="max_buy_count">
                                <div class="input-group-append">
                                    <span class="input-group-text">件</span>
                                </div>
                            </div>
                        </li>
                    </ul>

                    <div class="color-9 mt10">默认不限购,可限制每人可购买数量</div> 
                </div>

            </div>
        </div>
    </div>

2、layer方法

 layer.open({
        type: 1,
        area: ['450px', '200px'],
        title: '批量设置限购',
        btn: ['确定', '取消'],//按钮
        content: $('#settingXiangou_show_div'),
        yes: function (index, layero) {}
});

 

已标记关键词 清除标记