기존 특정영역 스크립트는 영역을 감싸는 div태그 내부에 div태그가 존재 할때
글씨가 보이지 않거나 프린트버튼 클릭시 관련object들이 겹치는 현상이 있었음.
새창으로 깔끔하게 문제해결!!!
<html>
<head>
<title>특정영역인쇄 팝업</title>
<script type="text/javascript">
var win=null;
function printIt(printThis) {
win = window.open('','offprint','width=755 height=526');
self.focus();
win.document.open();
win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
win.document.write(printThis);
win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
win.document.close();
win.print();
win.close();
}
</script>
</head>
<body>
<a href="javascript :printIt(document.getElementById('printme').innerHTML)">Print</a><p>
<div id="printme">
여기서 부터~~~<p>
~~~~
여기까지만 출력됩니다.<br>
</div>
</body>
</html>
<head>
<title>특정영역인쇄 팝업</title>
<script type="text/javascript">
var win=null;
function printIt(printThis) {
win = window.open('','offprint','width=755 height=526');
self.focus();
win.document.open();
win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
win.document.write(printThis);
win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
win.document.close();
win.print();
win.close();
}
</script>
</head>
<body>
<a href="javascript
<div id="printme">
여기서 부터~~~<p>
~~~~
여기까지만 출력됩니다.<br>
</div>
</body>
</html>
