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

특정 부분 인쇄하기

페이지 정보

작성자 MintState 댓글 0건 조회 12,756회 작성일 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건 4 페이지
Javascript 목록
번호 제목 글쓴이 조회 날짜
118 MintState 15022 11-17
117 MintState 10094 11-17
116 MintState 10517 11-17
115 MintState 13324 11-17
114 MintState 11013 11-17
열람중 MintState 12757 11-17
112 MintState 11221 11-17
111 MintState 12375 11-17
110 MintState 12627 11-17
109 MintState 22373 11-17
108 MintState 15039 11-17
107 MintState 10823 11-17
106 MintState 12389 11-17
105 MintState 11169 11-17
104 MintState 11402 11-17
103 MintState 12197 11-17
102 MintState 11391 11-17
101 MintState 16205 11-17
100 MintState 12306 11-17
99 MintState 9781 11-17
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™