Buscar contenidos

viernes, 28 de septiembre de 2018

jQuery Plugin To Print Any Part Of Your Page - Print

https://www.jqueryscript.net/other/jQuery-Plugin-To-Print-Any-Part-Of-Your-Page-Print.html

https://jasonday.github.io/printThis/#nada

How to use it:

1. Specify an unique ID to your html element where you want to make it printable.
1<div id="printable">
2Your Content
3</div>
2. Create a button to print the specified html element.
1<button class="print"> Print this </button>
3. Import the latest jQuery library and jQuery print plugin.
2<script src="../jQuery.print.js"></script>
4. Call the plugin on the print button.
1<script type='text/javascript'>
2$(function() {
3$("#printable").find('.print').on('click', function() {
4$.print("#printable");
5});
6});
7</script>

No hay comentarios:

Publicar un comentario