我需要使用 Bootstrap 模板在模式窗口中显示注册表单。
我的示例应该通过按 [R] 元素打开,但事实并非如此。但是在示例中(http://www.w3resource.com/twitter-bootstrap/modals-tutorial.php)它确实如此。
在我的示例中,该属性似乎无法正常工作:
data-toggle="modal"
为什么?
代码:http: //jsfiddle.net/Mfc7M/
<!DOCTYPE html>
<title>Twitter Bootstrap Modals Example</title>
<body>
<div id="reg-model-dialog" class="modal hide fade in" style="display: none; ">
<div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
<h3>Registration</h3>
</div>
<div class="modal-body">
<table id="search-tbl">
<tr>
<td>Email:</td>
<td>
<input type="text" name="reg-email" id="reg-email" />
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="text" name="reg-pwd" id="reg-pwd" value="" />
</td>
</tr>
</table>
</div>
<div class="modal-footer"> <a href="#" class="btn btn-success">Call to action</a> <a href="#" class="btn" data-dismiss="modal">Close</a>
</div>
</div> <a data-toggle="modal" href="#regstration" class="btn btn-primary btn-large" id="reg-dialog-btn">R</a>
和
$(document).ready(function () {
//$("#reg-model-dialog").modal();
/* $('#reg-dialog-btn').click(function(){
$('#reg-model-dialog').css('display','inline');
}); */
});