Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * @Funcion: imprSelec
- * @Params: cls-ocultar --> es el class de lo que
- * se va ocultar en la impresion
- * areaImpresion: Id del div que se va imprimir
- * @Descripcion: Imprime un div de html.
- * @Autor: Jose Luis Yacelly
- * */
- function imprSelec(areaImpresion) {
- //$('#' + areaImpresion).printThis();
- $('.cls-ocultar').hide();
- var estilos = '';
- $("link[rel=stylesheet]").each(function () {
- var href = $(this).attr("href");
- if (href) {
- var media = $(this).attr("media") || "all";
- estilos = estilos + '<link type="text/css" rel="stylesheet" href="' + href + '" media="' + media + '">';
- }
- });
- var ficha = $('#' + areaImpresion);
- var ventimp = window.open(' ', 'popimpr');
- ventimp.document.write('<html><head>' + estilos + '</head><body>');
- ventimp.document.write(ficha.html());
- ventimp.document.write('</body>');
- ventimp.document.write('</html>');
- ventimp.document.close();
- ventimp.print();
- ventimp.close();
- $('.cls-ocultar').show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement