i use bootstrap modal in partialview not working, but working in view
dont know what happen, anyone can help me, thanks!
my code
@Html.Partial("_Header") (in layout)
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">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>
$(function () {
$('#myModal').modal({
backdrop: true,
keyboard: false,
show: false
});
});
</script>
http://s23.postimg.org/lfotq8xsb/image.jpg
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…