javascript | 특정 영역 팝업후 프린트 하기
페이지 정보
작성자 100K5 작성일12-04-01 09:57 조회59,844회 댓글0건관련링크
본문
<script type="text/javascript">
<!--
function pagePrint(obj) {
var w = obj.offsetWidth;
var h = obj.offsetHeight;
var features = "menubar=no, toolbar=no, location=no, directoreis=no, status=no, scrollbar=yes, resizable=yes, width=" + w + ", height=" + h + ", left=0, top=0";
var PrintPage = window.open("about:blank", obj.id, features);
PrintPage.document.open();
PrintPage.document.write("<html><head><title></title><link type='text/css' rel='stylesheet' href='../common/css/import.css'/><style type='text/css'>body{background::}</style>\n<head>\n<body>" + obj.innerHTML + "\n</body></html>");
PrintPage.document.close();
PrintPage.document.title = document.domain;
PrintPage.print(PrintPage.location.reload());
}
//-->
</script>
<!--
function pagePrint(obj) {
var w = obj.offsetWidth;
var h = obj.offsetHeight;
var features = "menubar=no, toolbar=no, location=no, directoreis=no, status=no, scrollbar=yes, resizable=yes, width=" + w + ", height=" + h + ", left=0, top=0";
var PrintPage = window.open("about:blank", obj.id, features);
PrintPage.document.open();
PrintPage.document.write("<html><head><title></title><link type='text/css' rel='stylesheet' href='../common/css/import.css'/><style type='text/css'>body{background::}</style>\n<head>\n<body>" + obj.innerHTML + "\n</body></html>");
PrintPage.document.close();
PrintPage.document.title = document.domain;
PrintPage.print(PrintPage.location.reload());
}
//-->
</script>
소스
<!-- 이벤트 핸들러 -->
onclick="pagePrint(document.getElementById('print_page'))"
onclick="pagePrint(document.getElementById('print_page'))"
댓글목록
등록된 댓글이 없습니다.