0

也许我犯了一个简单的错误,但不能让它从 jsfiddle.net 复制的代码工作。

这是jsfiddle.net的链接

这是我正在使用的代码,但由于某种原因引导模式未打开:

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> - jsFiddle demo</title>
<script src="http://code.jquery.com/jquery-1.7.1.js" type="text/javascript"></script>
<script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap" type="text/javascript"></script>
<script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.js" type="text/javascript"></script>
<link href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.css" type="text/css" rel="stylesheet">
<style type="text/css">
button {border: 1px #AAA solid; padding: 4px 10px;}
.hide {display: none;}
</style>
<script type="text/javascript">
//<![CDATA[
$(window).load(function(){
$("a[data-toggle=modal]").click(function() {
var sol_id = $(this).attr('id');
$('#myModal').bind('show', function() {
removeBtn = $(this).find('.danger'), href = removeBtn.attr('href');
removeBtn.attr('href', href.replace(/ref=\d*/, 'ref=' + sol_id));
}).modal({
backdrop: true
});
});
});//]]>
</script>
</head>
<body>
<a id="567" href="#myModal" data-toggle="modal">
<i class="pull-right icon-eye-open"></i>
HTML
</a>
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Title</h3>
</div>
<div class="modal-body">
<div id="modalContent" style="display:none;"> </div>
</div>
<div class="modal-footer">
<a class="btn danger" href="delete.php?ref=">Yes</a>
<a class="btn secondary" href="javascript:$('#modal-from-dom').modal('hide')">No</a>
</div>
</div>
</body>
</html>
4

0 回答 0