jquery - Can I Modify this Javascript to Print Images from Div? -
jquery - Can I Modify this Javascript to Print Images from Div? -
i have div in page layout print. have worked through sample code on how , come following:
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" > </script> <script type="text/javascript"> function printelem(elem) { popup($(elem).text()); } function popup(data) { var mywindow = window.open('', 'print_div', 'height=400,width=600'); mywindow.document.write('<html><head><title>print window</title>'); mywindow.document.write('</head><body >'); mywindow.document.write(data); mywindow.document.write('</body></html>'); mywindow.document.close(); mywindow.print(); homecoming true; } </script>
then in body of html place next button:
<input type="button" value="print division" onclick="printelem('#print_div')" />
this works great creating quick print of text based content on page, need print out images beingness displayed on page well. can alter script this?
couldn't do:
function printelem(elem) { popup($(elem).html()); }
reference: http://api.jquery.com/html/
javascript jquery image html printing
Comments
Post a Comment