此代码打开一个模式框。但我的问题是,当我试图打开它与我的编辑目的模式框不工作的不同的ID。我想添加这个代码<input type="button" value="Edit Item" id="edit">
使用另一个ID打开一个模式框。但为什么不工作? 第一格,形式,表,第二个div:打开模式框不起作用
<input type="button" value="Add New Item" id="add_new">
<div class="entry-form">
<form name="userinfo" id="userinfo">
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2" align="right"><a href="#" id="close">Close</a></td>
</tr>
<tr>
<td>Item</td>
<td><input type="text" name="items" id="items" value="" class="inputs" autocomplete="off"></td>
</tr>
</div>
<script>
$(document).ready(function(){
$("#add_new").click(function(){
$(".entry-form").fadeIn("fast");
});
$("#close").click(function(){
$(".entry-form").fadeOut("fast");
});
});
</script>
无效的标记,无论是形式,表或包装DIV被关闭。 – adeneo
@adeneo为什么关闭? – user3462269