Categoria
Códigos adicionados no site: 18
Temas para Código
Abertura arquivo pdf em Dialog Modal (BS e JQuery)
Palavras-chaves: JQuery, Bootstrap, Javascript, PDF, |
Cadastro: 14/10/2025 00:18:22 | Atualização: 14/10/2025 00:21:02
Cadastro: 14/10/2025 00:18:22 | Atualização: 14/10/2025 00:21:02
/*
Utiliza bootstrap v 5.X e Jquery v3.7.X
*/
(function (a) {
a.createModal = function (b) {
defaults = { title: "", message: "Leitor de PDF", closeButton: true, scrollable: false };
var b = a.extend({}, defaults, b);
var c = (b.scrollable === true) ? 'style="min-width: 600px; max-height: 620px;overflow-y: auto;"' : "";
html = '';
html += '';
html += '";
html += "";
html += "";
a("body").prepend(html);
a("#ModalPDF").modal().on("hidden.bs.modal", function () { a(this).remove() })
}
})(jQuery);
$(function () {
$('.view-pdf').on('click', function () {
var pdf_link = $(this).attr('href');
var iframe = ''
$.createModal({
title: 'Leitor de PDF Plugin',
message: iframe,
closeButton: true,
scrollable: false
});
return false;
});
})