【问题标题】:JQuery - Tag IT (availableTags) not working inside bootstrap modalJQuery - 标记 IT(availableTags)在引导模式中不起作用
【发布时间】:2018-03-09 04:53:47
【问题描述】:

我需要帮助,

我的标签在引导模式中无法正常工作,

当我从 Bootstrap 模式中输入时,availableTags 选项不会显示,

但是当我把它放在引导模式之外时,availableTags 出现了。

这是我的代码,

<head>
    <!-- Include JQUERY and JQUERY UI and JQUERY TAG IT -->
    <script>
        $(function(){
            var sampleTags = ['c++', 'java', 'php', 'coldfusion', 'javascript', 'asp', 'ruby', 'python', 'c', 'scala', 'groovy', 'haskell', 'perl', 'erlang', 'apl', 'cobol', 'go', 'lua'];

            $('#serverTagsInsideModal').tagit({
                    availableTags: sampleTags
            });    

            $('#serverTagsOutsideModal').tagit({
                availableTags: sampleTags
            });

        });
    </script>
</head>

<body>
    <div id="newServerModal" class="modal fade" role="dialog">
        <div class="modal-dialog modal-lg">
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Add New Server</h4>
                </div>
                <div class="modal-body">

                    <div class="form-group">
                        <label  for="server_tag">Server Tags</label>
                        <ul id="serverTagsInsideModal"></ul>
                    </div>    
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal">Save</button>
                </div>
            </div>
        </div>
    </div>
    <ul id="serverTagsOutsideModal"></ul>
</body>

【问题讨论】:

    标签: jquery html tag-it


    【解决方案1】:

    你可能已经找到了,但这个答案为我解决了这个问题:

    https://github.com/aehlke/tag-it/issues/171

    .ui-autocomplete
    {
    z-index: 1051;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-25
      • 1970-01-01
      • 2016-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多