YesYo.com MintState Forums
뒤로    Go3.co.kr MintState BBS > Tech > Javascript
검색
멤버이름    오토
비밀번호 
 

특정 부분 인쇄하기

페이지 정보

작성자 MintState 댓글 0건 조회 13,059회 작성일 08-11-17 13:11

본문

특정 부분 인쇄하기

특정 부분을 지정 하여서 프린트 하는 방법 입니다.
첨부파일을 확인하세요..

01<html>
02<head>
03<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
04<title>인쇄페이지</title>
05<SCRIPT LANGUAGE="JavaScript">
06<!--//
07function startPrint() {
08    var openerURL = opener.location.pathname;
09 
10    var openerIndex = openerURL.lastIndexOf("/") + 1;
11    var openerPath = openerURL.substr(0, openerIndex);
12        openerPath = escape(openerPath);
13 
14    var newContent = opener.forPrint.innerHTML;
15        newContent = escape(newContent)
16 
17        newContent = AbsolutePath(newContent,"%22../",openerPath);
18        newContent = AbsolutePath(newContent,"%27../",openerPath);
19        newContent = AbsolutePath(newContent,"%3D../",openerPath);
20 
21        document.all.forPrint.innerHTML = unescape(newContent);
22        window.print();
23}
24function AbsolutePath(contentstr,findstr,restr){
25    var temp="";
26    var r;
27    do{
28        r=contentstr.indexOf(findstr,0);                                                 
29        if(r>0){
30            temp=temp+contentstr.substring(0,r+3);
31            temp=temp+restr;
32            contentstr=contentstr.substring(r+3,contentstr.length);
33        }
34    }while(r>0)
35    temp=temp+contentstr;
36    return temp;
37}
38//-->
39</SCRIPT
40</head>
41<body onload="Javascript:startPrint();">
42    <DIV ID="forPrint"></DIV>
43</body>
44</html>


01<script type="text/javascript">
02function contentPrint() {
03    var windowLeft = (screen.width-640)/2;
04    var windowTop = (screen.height-480)/2;
05    var printURL = "./forPrint.html";
06    window.open(printURL,"print",'width=665, height=550, menubar=no, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
07}
08</script>
09<a href="javascript:contentPrint();" title="인쇄하기">인쇄하기</a>
10<div id="forPrint">
11인쇄 내용<br />인쇄내용<br />
12인쇄 내용<br />인쇄내용<br />
13인쇄 내용<br />인쇄내용<br />
14인쇄 내용<br />인쇄내용<br />
15</div>
첨부 파일
파일 종류: rar print_page.rar (1.1K, 53 views)

댓글목록

등록된 댓글이 없습니다.

Total 179건 4 페이지
Javascript 목록
번호 제목 글쓴이 조회 날짜
119 MintState 10694 11-17
118 MintState 15306 11-17
117 MintState 10355 11-17
116 MintState 10798 11-17
115 MintState 13581 11-17
114 MintState 11365 11-17
열람중 MintState 13060 11-17
112 MintState 11497 11-17
111 MintState 12658 11-17
110 MintState 12893 11-17
109 MintState 22688 11-17
108 MintState 15335 11-17
107 MintState 11082 11-17
106 MintState 12642 11-17
105 MintState 11456 11-17
104 MintState 11659 11-17
103 MintState 12459 11-17
102 MintState 11640 11-17
101 MintState 16504 11-17
100 MintState 12556 11-17
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2025, Go3.co.kr MintState. ™