前端模態對話框
阿新 • • 發佈:2017-09-25
file -1 bootstrap oda div modal save times doctype
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="/static/dist/css/bootstrap.css">
</head>
<body>
<button type="button" class="btn btn-primary btn-lg" onclick="handleshow();">
登陸
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script src={% static "dist/js/jquery-3.2.1.js" %}></script>
<script src={% static "dist/js/bootstrap.js" %}></script>
<script>
function handleshow() {
$(‘#myModal‘).modal("show");
}
</script>
</body>
</html>
前端模態對話框