twitter-bootstrap - Bootstrap typeahead 在 Bootstrap 模式中不起作用

标签 twitter-bootstrap bootstrap-typeahead

我正在使用 codeigniter 框架,我正在使用 bootstrap typeahead,一切都很好,但我的问题是当我将它放在 bootstrap 模式中时,bootstrap typeahead 将不起作用。有人能帮我吗?请。这是我的代码

<a data-target="ajaxify" data-toggle="modal" href="<?php echo base_url()?>task/add_task" class="no-u quick-task">
    <h4>Task</h4>
    <span>This is a simple description</span>
 </a>

在我的 add_task Controller 中,我调用了 View task_view.php 和 task.js,但似乎预输入在 Bootstrap 模式中不起作用。

这是 task.js 的内容
$(document).ready(function(){
$("#assign_to").typeahead({
    source: [{value: 'Charlie'}, {value: 'Gudbergur'}]              
});
});

这是 task_view.php 的内容:只是一个示例。
<div id="ajaxx" class="modal hide fade">
<div class="modal-header">
  <a class="close" data-dismiss="modal">&times;</a>
  <!--Your title here -->
  <h3>Modal Heading</h3>

</div>
<div class="modal-body">
<form><input type="text" name="assign_to" id="assign_to" /></form>
</div>
<div class="modal-footer">
  <!--Your dont change the attributes only the value here -->
  <a href="#" id="n0" class="btn n0" data-dismiss="modal">Close</a>
  <a href="#" id="y1" class="btn btn-primary y1" data-submit="modal">Save</a>
</div>

最佳答案

您需要在 .typeahead 上放置一个 1051 的 z-index 以使其显示在模态 div 上方。

关于twitter-bootstrap - Bootstrap typeahead 在 Bootstrap 模式中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10220866/

相关文章:

javascript - 如何组合两个 jQuery 函数的代码以减少执行时间?

html - 表单输入和提交按钮未对齐

html - Bootstrap 4 页脚到底部高度

javascript - 为什么 typeahead.js 没有显示 ajax 响应中的所有项目?

django - Django 的预输入自动完成

javascript - 限制输入结果

javascript - 如何删除 CSS 样式?

php - 如何在 Bootstrap 轮播中显示相同大小的图像

css - bootstrap - 在列内添加 div 以水平对齐

javascript - 如何使用自定义参数让预先输入填充我的搜索栏?