更新这似乎不再是使用edge jQuery的最新Fx / Chrome中的问题
问题:自动填充功能将在对话框后面,如果您移动它,对话框将移出页面。
研究
我已经检查了
Why does jquery ui dialog mangle my jquery.tokeninput.js autocomplete?
并阅读github请求
但我仍然遇到与我认为最新的一切相关的问题(来自github jQuery TokenInput的TokenInput JS和CSS)。
DEMOS AND CODE
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" type="text/css" />
<script type="text/javascript" src="jquery.tokeninput.js"></script>
<link rel="stylesheet" href="token-input-facebook.css" type="text/css" />
<button id="filterBut">FILTER</button>
<div id="dialog-form" title="Filter" style="border:1px solid black">
<p class="validateTips">Enter text contained in the respective fields</p>
<form>
<fieldset>
<label for="name">Field1</label><br/><input type="text" name="Flt1" id="Flt1" class="text ui-widget-content ui-corner-all" style="width:300px"/><br/><br/>
<label for="email">Field2</label><br/><input type="text" name="Flt2" id="Flt2" value="" class="text ui-widget-content ui-corner-all" style="width:300px" />
</fieldset>
</form>
</div>
<script>
$(function() {
$("#Flt1, #Flt2").tokenInput([
{id: 7, name: "Ruby"},
{id: 11, name: "Python"},
{id: 13, name: "JavaScript"},
{id: 17, name: "ActionScript"},
{id: 19, name: "Scheme"},
{id: 23, name: "Lisp"},
{id: 29, name: "C#"},
{id: 31, name: "Fortran"},
{id: 37, name: "Visual Basic"},
{id: 41, name: "C"},
{id: 43, name: "C++"},
{id: 47, name: "Java"}
],{theme:"facebook"});
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 400,
width: 460,
modal: true
});
$( "#filterBut" ).click(function() {
// suggestion from
// https://stackoverflow.com/questions/6669654/why-does-jquery-ui-dialog-mangle-my-jquery-tokeninput-js-autocomplete
$("#dialog-form script").remove();
// does not seem to change anything
$( "#dialog-form" ).dialog( "open" );
});
});
</script>
</div>
</div>
</form>
答案 0 :(得分:2)
答案 1 :(得分:2)
更改div.token-input-dropdown的样式并使用z-index:1005重放z-index:1。
答案 2 :(得分:0)
我对你的HTML工作了一下,好像设置了zindex:1005显示了对话框的下拉列表。
],{theme:"facebook", zindex:1005});
但是,如果移动对话框,自动完成下拉列表将保留在上一个位置。
答案 3 :(得分:0)
这个jQuery代码解决了我的隐藏问题(感谢@ user2192014和this answer这个想法):
$(".token-input-dropdown-facebook, .token-input-list-facebook").css("z-index","9999");