我使用codeigniter框架,我使用引导typeahead和一切都很好,但我的问题是,当我把它放在bootstrap模式的bootstrap typeahead将无法正常工作。有人能帮我吗?请。这是我的代码Bootstrap typeahead not Bootstrap Modal内工作
<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控制器中我调用视图task_view.php和task.js但似乎预输入不引导模式内工作。
这是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">×</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>
感谢您的帮助,但它似乎的z-index设置为1051不能正常工作。我认为当我将它放入模式中时,我为typeahead所做的JavaScript将不会包含在DOM中。任何人都可以帮助我。请使用codeigniter和twitter bootstrap。 – user1342825 2012-04-23 10:09:58
键入头插入到模态区域外的dom中,并显示在模态下方。我能够通过添加.typeahead {z-index:1051; }到bootstrap.css中。这与处理未在模式中显示的下拉菜单的技巧相同(https://github.com/twitter/bootstrap/pull/1221) – deafgreatdane 2012-05-29 12:47:37
+1他们声称问题已在最新版本中。但不是。我仍然遇到与bootstrap 2.1.1相同的问题。 – Houman 2012-09-11 18:07:59