gpt4 book ai didi

Twitter Bootstrap 模态数据关闭

转载 作者:行者123 更新时间:2023-12-02 16:59:46 25 4
gpt4 key购买 nike

我正在尝试让模态数据关闭操作在单击时关闭模态。似乎有一个问题我找不到记录,希望这里有人可以阐明它。这是代码

<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'/>
<title> Modal test </title>
<link href='themes/default/bootstrap/css/bootstrap.css' rel='stylesheet'/>
<link href='themes/default/bootstrap/css/bootstrap-responsive.css' rel="stylesheet"/>
</head>
<body>
<div class="modal" id="myModal">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
<div class="alert alert-block">
<a class="close" data-dismiss="alert" href="#">x</a>
<h4 class="alert-heading">Warning!</h4>
Best check yo self, you're not...
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="themes/default/bootstrap/js/bootstrap.js"></script>
</body>
</html>

是全套 bootstrap,包括 bootstrap-modal.js

我输入了<div class="alert alert-block">为了测试操作,它似乎在警报中起作用,但在模态中不起作用!

最佳答案

请添加此代码:

<script  type="text/javascript">
$(document).ready(function() {
$('#myModal').modal(); // initialized with defaults
$('#myModal').modal('show'); // open your modal dialog
});
</script>

关于Twitter Bootstrap 模态数据关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10790041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com