부분 프린터하기
기존에 대부분 스킨에서 프린트 기능을 구현하려면,
간단하게는 window.print(); 를 사용해서 전체를 프린트 하게 하거나...
새창으로 띄워서 새창 전체를 프린트하는 기법을 사용하는데...
새창안을 띄우지 않고 필요한 부분만 프린트하는 소스입니다.
일단 게시물 본문만 프린트 하려면 아래와 같이 추가해 주시면 됩니다.
<iframe name=print_content id=print_content width=1 height=1 style="visibility:hidden;"></iframe>
<script>
function content_printer ()
{
print_content.document.open();
print_content.document.writeln("<html><head><style>body,td,p,pre,input,textarea,select,option,a,a:hover {font-size:9pt; font-family:tahoma,굴림;}</style></head><body>"); //스타일등을 지정
print_content.document.writeln('<?=$memo?>'); // 본문 출력
print_content.document.writeln("</body></html>");
print_content.document.close();
print_content.document.execCommand('Print');
}
</script>
<a onclick="content_printer();" style="cursor:hand;">프린트하기</a>
간단하게는 window.print(); 를 사용해서 전체를 프린트 하게 하거나...
새창으로 띄워서 새창 전체를 프린트하는 기법을 사용하는데...
새창안을 띄우지 않고 필요한 부분만 프린트하는 소스입니다.
일단 게시물 본문만 프린트 하려면 아래와 같이 추가해 주시면 됩니다.
<iframe name=print_content id=print_content width=1 height=1 style="visibility:hidden;"></iframe>
<script>
function content_printer ()
{
print_content.document.open();
print_content.document.writeln("<html><head><style>body,td,p,pre,input,textarea,select,option,a,a:hover {font-size:9pt; font-family:tahoma,굴림;}</style></head><body>"); //스타일등을 지정
print_content.document.writeln('<?=$memo?>'); // 본문 출력
print_content.document.writeln("</body></html>");
print_content.document.close();
print_content.document.execCommand('Print');
}
</script>
<a onclick="content_printer();" style="cursor:hand;">프린트하기</a>
댓글 10개
쉽다zzz
12년 전
잘 쓰겠습니다.
senseme
12년 전
네..좋은 자료가 되었으면 좋겠네욧.
12년 전
냠냠;;;;;;;;;
<script>
function printHTML() {
Pwin = window.open("","","width=900,height=800,scrollbars=1");
wdata ="<HTML>";
wdata += document.getElementById("print").innerHTML;
wdata += "";
Pwin.document.write(wdata);
Pwin.window.print();
Pwin.window.location.reload();
}
</script>
<div id="print">
프린트할부분을 div로 감싸준다
</div>
저는 이거 쓰는데..........
<script>
function printHTML() {
Pwin = window.open("","","width=900,height=800,scrollbars=1");
wdata ="<HTML>";
wdata += document.getElementById("print").innerHTML;
wdata += "";
Pwin.document.write(wdata);
Pwin.window.print();
Pwin.window.location.reload();
}
</script>
<div id="print">
프린트할부분을 div로 감싸준다
</div>
저는 이거 쓰는데..........
senseme
12년 전
새로운 팁을 알게되었네요..감사합니다.
DanEtre
12년 전
감사합니다.^^
senseme
12년 전
감사합니다^^
쉽다zzz
12년 전
잘봤어요~
senseme
12년 전
감사합니다^^
12년 전
감사용
takumi22
12년 전
잘봤습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6330 |
|
12년 전 | 1801 | |
| 6329 |
내가짱니네가짱
|
12년 전 | 1231 | |
| 6328 |
AMDbest
|
12년 전 | 493 | |
| 6327 | 12년 전 | 1706 | ||
| 6326 | 12년 전 | 1337 | ||
| 6325 | 12년 전 | 7623 | ||
| 6324 |
AMDbest
|
12년 전 | 2206 | |
| 6323 |
|
12년 전 | 1978 | |
| 6322 | 12년 전 | 2040 | ||
| 6321 | 12년 전 | 2487 | ||
| 6320 |
senseme
|
12년 전 | 592 | |
| 6319 | 12년 전 | 3737 | ||
| 6318 | 12년 전 | 1387 | ||
| 6317 |
kiplayer
|
12년 전 | 6419 | |
| 6316 | 12년 전 | 1021 | ||
| 6315 | 12년 전 | 976 | ||
| 6314 |
상엽나르도
|
12년 전 | 1288 | |
| 6313 |
검은고양이1983
|
12년 전 | 656 | |
| 6312 | 12년 전 | 3120 | ||
| 6311 | 12년 전 | 1416 | ||
| 6310 |
testers
|
12년 전 | 1486 | |
| 6309 | 12년 전 | 988 | ||
| 6308 | 12년 전 | 2605 | ||
| 6307 | 12년 전 | 1656 | ||
| 6306 | 12년 전 | 439 | ||
| 6305 | 12년 전 | 3501 | ||
| 6304 | 12년 전 | 1000 | ||
| 6303 | 12년 전 | 826 | ||
| 6302 | 12년 전 | 1191 | ||
| 6301 | 12년 전 | 5571 | ||
| 6300 |
|
12년 전 | 1203 | |
| 6299 |
AMDbest
|
12년 전 | 2807 | |
| 6298 |
AMDbest
|
12년 전 | 2252 | |
| 6297 |
프리랜서개발자
|
12년 전 | 478 | |
| 6296 | 12년 전 | 2937 | ||
| 6295 |
SUPERMANs
|
12년 전 | 1389 | |
| 6294 | 12년 전 | 1294 | ||
| 6293 | 12년 전 | 1348 | ||
| 6292 |
오늘도망했다
|
12년 전 | 3274 | |
| 6291 |
senseme
|
12년 전 | 2033 | |
| 6290 |
senseme
|
12년 전 | 3690 | |
| 6289 |
senseme
|
12년 전 | 8582 | |
| 6288 |
senseme
|
12년 전 | 4175 | |
| 6287 |
senseme
|
12년 전 | 3747 | |
| 6286 |
senseme
|
12년 전 | 1365 | |
| 6285 |
senseme
|
12년 전 | 1440 | |
| 6284 |
프로프리랜서
|
12년 전 | 3161 | |
| 6283 |
프로프리랜서
|
12년 전 | 3994 | |
| 6282 |
프로프리랜서
|
12년 전 | 4398 | |
| 6281 |
프로프리랜서
|
12년 전 | 1607 | |
| 6280 | 12년 전 | 1292 | ||
| 6279 |
AMDbest
|
12년 전 | 882 | |
| 6278 | 12년 전 | 982 | ||
| 6277 |
senseme
|
12년 전 | 2722 | |
| 6276 |
senseme
|
12년 전 | 2736 | |
| 6275 |
senseme
|
12년 전 | 1262 | |
| 6274 |
|
12년 전 | 2806 | |
| 6273 | 12년 전 | 1279 | ||
| 6272 | 12년 전 | 8463 | ||
| 6271 |
senseme
|
12년 전 | 1514 | |
| 6270 |
senseme
|
12년 전 | 3773 | |
| 6269 |
senseme
|
12년 전 | 6382 | |
| 6268 |
senseme
|
12년 전 | 1566 | |
| 6267 | 12년 전 | 2844 | ||
| 6266 | 12년 전 | 581 | ||
| 6265 | 12년 전 | 1304 | ||
| 6264 | 12년 전 | 1160 | ||
| 6263 |
senseme
|
12년 전 | 1321 | |
| 6262 |
senseme
|
12년 전 | 3315 | |
| 6261 |
senseme
|
12년 전 | 1091 | |
| 6260 |
senseme
|
12년 전 | 1832 | |
| 6259 |
senseme
|
12년 전 | 1261 | |
| 6258 |
senseme
|
12년 전 | 920 | |
| 6257 | 12년 전 | 1411 | ||
| 6256 | 12년 전 | 2104 | ||
| 6255 |
senseme
|
12년 전 | 1383 | |
| 6254 |
senseme
|
12년 전 | 1272 | |
| 6253 |
senseme
|
12년 전 | 1789 | |
| 6252 |
kiplayer
|
12년 전 | 14783 | |
| 6251 | 12년 전 | 1074 | ||
| 6250 | 12년 전 | 871 | ||
| 6249 | 12년 전 | 2729 | ||
| 6248 |
senseme
|
12년 전 | 8970 | |
| 6247 | 12년 전 | 1293 | ||
| 6246 |
프로프리랜서
|
12년 전 | 1170 | |
| 6245 |
프로프리랜서
|
12년 전 | 1629 | |
| 6244 |
프로프리랜서
|
12년 전 | 1131 | |
| 6243 |
프로프리랜서
|
12년 전 | 1265 | |
| 6242 |
프로프리랜서
|
12년 전 | 3554 | |
| 6241 |
프로프리랜서
|
12년 전 | 1460 | |
| 6240 |
프로프리랜서
|
12년 전 | 2126 | |
| 6239 |
softhead
|
12년 전 | 1147 | |
| 6238 |
senseme
|
12년 전 | 1316 | |
| 6237 |
senseme
|
12년 전 | 3033 | |
| 6236 | 12년 전 | 876 | ||
| 6235 | 12년 전 | 1346 | ||
| 6234 | 12년 전 | 1605 | ||
| 6233 | 12년 전 | 2036 | ||
| 6232 | 12년 전 | 2141 | ||
| 6231 | 12년 전 | 2569 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기