Reputation: 6756
I am trying to print my div content using printElement plugin. The div has a lot of text with in so there is a scrollbar. The problem is that plugin prints only the part of text which is actually on the screen. How can I print all of the text?
EDIT:
I need a solution which will print this div with styles which are in external css.
Upvotes: 6
Views: 49011
Reputation: 7682
https://github.com/jasonday/printThis
Configurable with additional css files, and other options.
Upvotes: 1
Reputation: 404
<div class="printclass">Print</div>
<div id="mydivid">
Your content goes here
</div>
</div>
<script type="text/javascript">
$(function(){
$( ".printclass" )
.attr( "href", "javascript:void(0)")
.click(function(){
// Print the DIV.
$( "#mydivid" ).print();
// Cancel click event.
return( false );
});
});
</script>
Upvotes: 0
Reputation: 37504
Have a look at this:
http://www.bennadel.com/blog/1591-Ask-Ben-Print-Part-Of-A-Web-Page-With-jQuery.htm
Upvotes: 3