这里有一个图片,展示了模态框的位置以及为什么它没有出现。我该如何修复?
楼主:
我使用的是与这个基本相同的jQuery UI模态框。当我打开我的页面并单击以打开注册模态框时,我会看到应该自动完成的文本框。当我输入匹配字符串的一部分时,没有任何内容显示。但是,如果我按键盘上的向上或向下箭头,它将滚动匹配项。这让我相信它被隐藏在模态框后面。
相关的模态框如下:
<div class="remodal" data-remodal-id="modal2">
<div class="logot">
<div class="favicon"><img src="{% static 'img/favicon.png' %}" /></div>
<h1>Complete the form to build your profile</h1>
<div class="logot-iner">
<form>
<p>
My name is
<input id="firstname" type="text" placeholder="first name" />
<input id="lastname" type="text" placeholder="last name" />
and I am a <span class="type">
<select id="studenttype">
<option>Full Time</option>
<option>Part Time</option>
</select>
</span> student
<br />
<br />
I am completing a <span class="type">
<select id="degreetype">
<option>Bachelors</option>
<option>Masters</option>
<option>Postgraduate</option>
</select>
</span> degree at<br />
<span class="type1">
<input id="university" type="text" placeholder="uni/college" />
</span>
<br />
<br />
I study/studied <span class="type2">
<input id="degree" type="text" placeholder="degree subject" />
</span> and I
am currently in my <span class="type">
<select id="year">
<option>First</option>
<option>Second</option>
<option>Third</option>
<option>Fourth or higher</option>
</select>
</span> year.
<br />
<br />
DOB: <span class="type3"><input id="dobday" type="text" placeholder="DD" /></span>
<span class="type3"><input id="dobmonth" type="text" placeholder="MM" /></span>
<span class="type3"><input id="dobyear" type="text" placeholder="YYYY" /></span>
<br />
<br />
My primary skill area is <span class="type">
<input id="skill" type="text" placeholder="skill area" />.
</span> <br />
<br />
<br />
My email is <span class="type">
<input id="email" type="text" placeholder="email" /> and my password is <span class="type">
<input id="password" type="password" placeholder="password" /></span></span></p>
<a href="" id="regpost">Register</a>
</p>
</form>
</div>
</div>
但相关的部分是
<input id="university" type="text" placeholder="uni/college" />
随附的JS是
var fakedata = ['harvard','yale','test3','test4','uni'];
/* PICK UNI AUTOCOMPLETE */
$('input#university').autocomplete({
source: fakedata
});
我猜需要在某个元素上设置z-index,但我不知道要设置它的元素名是什么。有任何想法吗?