etimbo / jquery-print-preview-plugin

jQuery plugin for print preview (modal window)
jquery-print-preview-plugin
382 stars 128 forks source link

Is it possible to show specific div as a Print Preview? #15

Open billytsr opened 10 years ago

billytsr commented 10 years ago

Is it possible to show specific div as a Print Preview instead of showing complete Page?I'm preferring dynamic div through Javascript or jQuery. Thanks.

srnimesh commented 9 years ago

yes, im also have the above mentioned doubt. I t takes the whole preview of a page. Is any solution for this? Thanks

jurgen-74 commented 8 years ago

I have a solution but it is not really satisfying: <style>.no-print{display: none;}</style>

<div class="no-print" id="001">

<script type="text/javascript" >$("#001").hover(function() { $(this).removeClass("no-print");}, function() {$(this).addClass("no-print");});</script>

HERE YOUR CONTENT OF THE DIV AND YOUR PRINT BUTTON:

<a class="print-preview" href="#" >print this part only</a>

</div>

The trick here is that when the user goes to the print button his mouse hovers over that area. This action removes the no-print class and makes the area visible for the plugin. You can see an example here: http://www.apologeet.nl/faq/tegenstrijdigheden