try this very simple code to make a popup :
<!-- Start Button trigger modal -->
<button type="button" class="btn
btn-primary btn-lg" data-toggle="modal"
data-target="#myModal">
Launch demo modal
</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">
...your
text or form here…
</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>
<!-- End Button trigger modal -->
<script>
$('#myModal').on('shown.bs.modal',
function () {
$('#myInput').focus()
})
</script>
No comments:
Post a Comment