%PDF- %PDF-
| Direktori : /disk/www/wwwroot/test-lingceed.echineselearning.biz/js/ |
| Current File : /disk/www/wwwroot/test-lingceed.echineselearning.biz/js/bootstrap.modal.vertically-center.js |
(function($) {
"use strict";
function centerModal() {
$(this).css('display', 'block');
var $dialog = $(this).find(".modal-dialog"), offset = ($(window).height() - $dialog.height()) / 2, bottomMargin = parseInt(
$dialog.css('marginBottom'), 10);
// Make sure you don't hide the top part of the modal w/ a negative
// margin if it's longer than the screen height, and keep the margin
// equal to the bottom margin of the modal
if (offset < bottomMargin) {
offset = bottomMargin;
}
$dialog.css("margin-top", offset);
}
$(document).on('show.bs.modal', '.modal', centerModal);
$(window).on("resize", function() {
$('.modal:visible').each(centerModal);
});
}(jQuery));