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

특정 부분 인쇄하기

페이지 정보

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

본문

특정 부분 인쇄하기

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>인쇄페이지</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function startPrint() {
	var openerURL = opener.location.pathname;

	var openerIndex = openerURL.lastIndexOf("/") + 1;
	var openerPath = openerURL.substr(0, openerIndex);
		openerPath = escape(openerPath);

	var newContent = opener.forPrint.innerHTML;
		newContent = escape(newContent)

		newContent = AbsolutePath(newContent,"%22../",openerPath);
		newContent = AbsolutePath(newContent,"%27../",openerPath);
		newContent = AbsolutePath(newContent,"%3D../",openerPath);

		document.all.forPrint.innerHTML = unescape(newContent);
		window.print();
}
function AbsolutePath(contentstr,findstr,restr){
	var temp="";
	var r;
	do{
		r=contentstr.indexOf(findstr,0);                                                  
		if(r>0){
			temp=temp+contentstr.substring(0,r+3);
			temp=temp+restr;
			contentstr=contentstr.substring(r+3,contentstr.length);
		}
	}while(r>0)
	temp=temp+contentstr;
	return temp;
}
//-->
</SCRIPT>  
</head>
<body onload="Javascript:startPrint();">
	<DIV ID="forPrint"></DIV>
</body>
</html>


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

댓글목록

등록된 댓글이 없습니다.

Total 178건 6 페이지
Javascript 목록
번호 제목 글쓴이 조회 날짜
78 MintState 16202 11-17
77 MintState 11389 11-17
76 MintState 12194 11-17
75 MintState 11396 11-17
74 MintState 11165 11-17
73 MintState 12386 11-17
72 MintState 10816 11-17
71 MintState 15037 11-17
70 MintState 22372 11-17
69 MintState 12625 11-17
68 MintState 12374 11-17
67 MintState 11217 11-17
열람중 MintState 12754 11-17
65 MintState 11007 11-17
64 MintState 13321 11-17
63 MintState 10514 11-17
62 MintState 10090 11-17
61 MintState 15017 11-17
60 MintState 10447 11-17
59 MintState 9806 11-17
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™