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

특정 부분 인쇄하기

페이지 정보

작성자 MintState 댓글 0건 조회 12,819회 작성일 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 16292 11-17
77 MintState 11453 11-17
76 MintState 12258 11-17
75 MintState 11477 11-17
74 MintState 11237 11-17
73 MintState 12449 11-17
72 MintState 10889 11-17
71 MintState 15115 11-17
70 MintState 22457 11-17
69 MintState 12690 11-17
68 MintState 12444 11-17
67 MintState 11298 11-17
열람중 MintState 12820 11-17
65 MintState 11138 11-17
64 MintState 13385 11-17
63 MintState 10590 11-17
62 MintState 10148 11-17
61 MintState 15106 11-17
60 MintState 10513 11-17
59 MintState 9876 11-17
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™