JAVA/Jquery
jquery 프린트하기
왕왕왕왕
2018. 2. 1. 13:20
$(document).ready( function() {
$("#print").click(function(){
var printWindow = window.open("", "", "width=1000,height=500");
printWindow.document.write("<img src='http://www.smotor.com/kr/images/event/cupon1.jpg' style='width:100%;'>");
printWindow.document.write("<script> setTimeout(function(){ window.print(); }, 1000); </script>");
printWindow.document.close(); // IE >= 10에 필요
printWindow.focus();
return false;
});
});