원하는부분인쇄
<HTML>
<HEAD>
<TITLE> 원하는 부분만 인쇄하기 </TITLE>
<script language="JavaScript">
var initBody function beforePrint() {
initBody = document.body.innerHTML; document.body.innerHTML = idPrint.innerHTML;
}
function afterPrint() {
document.body.innerHTML = initBody;
}
function printArea() {
window.print();
}
window.onbeforeprint = beforePrint; window.onafterprint = afterPrint;
</script>
</HEAD>
<BODY> 기본 문서 내용...<br> . <br> . <br> . <br> 인쇄할 때 제외될 영역 입니다. <br><br>
<div id="idPrint"> 이 부분만 인쇄를 하고 싶습니다. <br> </div>
<input type="button" value="부분 출력하기" onclick="printArea();">
</BODY>
</HTML>
---------------------------------------------------------------
이쇄가않되는페이지
<script language="javascript">
var hideBuf;
function hideBeforePrint() {
hideBuf = document.body.innerHTML;
document.body.innerHTML = '';
}
function showAfterPrint() {
document.body.innerHTML = hideBuf;
}
window.onbeforeprint = hideBeforePrint;
window.onafterprint = showAfterPrint;
</script>
<h1>인쇄가 안되는 페이지</h1>
[출처] 웹디황용
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|