Skip to content

레이어를 이용한 특정 범위 인쇄

MintState November 10, 2008 at 11:44 AM Views 13516

레이어를 이용한 특정 범위 인쇄

<script>
var initBody;
function beforePrint()
{ 
   initBody = document.body.innerHTML; 
   document.body.innerHTML = div_page.innerHTML;
} 

function afterPrint()
{ 
  document.body.innerHTML = initBody; 
} 

function pageprint()
{
     window.onbeforeprint = beforePrint; 
     window.onafterprint = afterPrint; 
     window.print(); 
}
</script>
<a href="#" onclick="pageprint()"> 인쇄하기</a>

<div id="div_page">
여기만 인쇄

여기만 인쇄

여기만 인쇄

여기만 인쇄
</div>
Share X Facebook LINE QR code

0 comments

Be the first to comment.