模态内的Pick-a-Color下拉显示

时间:2018-03-06 19:40:02

标签: javascript jquery colors

也许这个问题是重复的,但我没有找到问题的答案。

我在模态正文

中有一个div,其ID为tees
<div class="modal fade" id="modal_Setup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true">
        <div class="modal-dialog modal-wide">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">Col1</h4>
                </div>
                <div class="modal-body">
                    <div class="col-md-12 form-group">
                        <label class='col-md-2 control-label'></label>
                        <label class='col-md-5 control-label'>Col3</label>
                        <label class='col-md-2 control-label'>Col4</label>
                    </div>
                    <div id="tees" style="margin-bottom:20px; padding:0;">

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-danger" style="float:left;" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-success" onclick="changeColours()">Save</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

我以编程方式在div中添加内容

$("#tees").empty();
for (var j = 0; j < 7; j++) {
        for (var i = 0; i < Tees.length; i++)
            $("#tees").append("<div id='" + (i + 1) + "' teeid='" + Tees[i].Id + "' class='col-md-12 form-group'><label class='col-md-2 control-label' style='font-size:120%'>Tee " + (i + 1) + "</label>" +
                "<div class='col-md-5'><input id='teename_" + (i + 1) + "' value = '" Tees[i].Name + "'/></div>" +
                "<div class='col-md-2'><input id='colb_" + (i + 1) + "' value='" + Tees[i].BackColor + "' class='pick-a-color form-control' inline-dropdown='true'></div>")
}
$("#tees").append("<div style='clear:both'></div></div>")
$(".pick-a-color").pickAColor({ showSpectrum: false, showSavedColors: true, saveColorsPerElement: false, fadeMenuToggle: true, showHexInput: false, showBasicColors: true, allowBlank: false });

我不知道Pick-a-Color下拉列表是否可以显示在模态之外,因为现在它增加了我的模态大小,我需要滚动才能达到我想要的颜色。有人可以帮我吗?

0 个答案:

没有答案