我正在使用CSS3-Modal创建模态。
这是用于显示模态的html代码。
<div class="window activity" style="left: 120px; top:200px; display:none;" data-nodetype="activity" id="activitycontainer0">
<div class="ctrl_container">
<div class="button_remove">x</div>
</div>
<div class="details_container">
<label class="detail_label">Name</label>
<input type = "text" class="detail_text" name = "title"/><br/>
<p><a href = "#modal-activity" class = "button menu_button">Add Details</a></p>
</div>
</div>
当用户点击a href =“#modal-activity”class =“button menu_button”&gt; Add Details
时,它会显示模态。
这是模态的代码。
<!-- Modal for Activity -->
<div id="modal-activity">
<div class="modal-content">
<div class="header">
<h2>Details</h2>
</div>
<div class="copy">
<label class = "detail_label">Subprocess</label><br/>
<select name = "subprocess">
<option value = "1">1</option>
<option value = "2">2</option>
<option value = "3">3</option>
</select><br/>
<label class = "detail_label">Message</label></br/>
<textarea name = "msg" class = "detail_text" value = "thisisvalue"></textarea><br/>
<label class= "detail_label">Data Name</label><br/>
<select name ="jsonNodes">
<option value = "1">1</option>
<option value = "2">2</option>
<option value = "3">3</option>
</select><br/> <hr/>
<a href="#" class="button menu_button">Close</a>
<button class="button menu_button" onclick = "save();">Save</button>
</div>
</div>
<div class="overlay"></div>
</div>
<!--End of Modal -->
它工作正常,但是你怎么能在这个模态中添加ID,因为我已经尝试过显示它,它是同样的模态,当它不应该出现时继续出现。
这可能吗?我是新来的,谢谢。