3
I am standardizing the modal visualization effects, in this project I have both bootstrap modal and dialog, it turns out that both have distinct effects. wanted to leave them only with fade in, bootstrap pattern.
Example:
$(function() {
$("#dialog").dialog({
autoOpen: false,
modal: true,
show: "fade"
});
$("#btnDialog").on("click", function() {
$("#dialog").dialog("open");
});
$("#btnModal").on("click", function() {
$("#modal").modal("show");
});
});
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<div id="dialog" title="Basic dialog">
<p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modal">
<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">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
</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>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<button id="btnDialog">Open Dialog</button>
<button id="btnModal">Open Modal</button>
I tried to get the bootstrap fade css and add it in the ui dialog, but it didn’t help.
And create a dialog with modal? remove footer and maintain header. No use?
– Jorge B.
The issue is not the appearance, because this I solved in css, the two are equal, the problem is the transition effect in the modal of the bootstrap it goes down, in the dialog it only appears increasing the visibility
– Gabriel Rodrigues
Yes, but the idea I gave would solve this problem, if they were both modal.
– Jorge B.
You are talking to remove all dialog and leave only modal?
– Gabriel Rodrigues
Yes, and use modal as dialog. It cannot be?
– Jorge B.
This is a definitive solution that I intend to adopt, but the system is very large and uses a lot of dialog, it would not be something quick to do, all new implementations are already requested to create in the modal model of bootstrap...
– Gabriel Rodrigues
I think it was the best way, while that leaves it at that, there’s no great stress, or there’s?
– Jorge B.
I think the problem is in css
– Jasar Orion