부분 프린터하기
기존에 대부분 스킨에서 프린트 기능을 구현하려면,
간단하게는 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년 전
잘봤습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5730 | 13년 전 | 778 | ||
| 5729 | 13년 전 | 3591 | ||
| 5728 | 13년 전 | 1162 | ||
| 5727 |
freejazzme
|
13년 전 | 1115 | |
| 5726 | 13년 전 | 1453 | ||
| 5725 |
itlang
|
13년 전 | 438 | |
| 5724 | 13년 전 | 519 | ||
| 5723 |
crocojea
|
13년 전 | 1505 | |
| 5722 | 13년 전 | 1986 | ||
| 5721 | 13년 전 | 714 | ||
| 5720 |
쿠우우우우
|
13년 전 | 472 | |
| 5719 | 13년 전 | 621 | ||
| 5718 |
|
13년 전 | 596 | |
| 5717 | 13년 전 | 1453 | ||
| 5716 |
|
13년 전 | 1044 | |
| 5715 | 13년 전 | 471 | ||
| 5714 | 13년 전 | 473 | ||
| 5713 | 13년 전 | 537 | ||
| 5712 |
|
13년 전 | 775 | |
| 5711 | 13년 전 | 700 | ||
| 5710 |
minini
|
13년 전 | 493 | |
| 5709 |
|
13년 전 | 1336 | |
| 5708 | 13년 전 | 689 | ||
| 5707 | 13년 전 | 5862 | ||
| 5706 |
오니기리죠
|
13년 전 | 1028 | |
| 5705 |
HSEngine
|
13년 전 | 659 | |
| 5704 |
Giggle
|
13년 전 | 1699 | |
| 5703 | 13년 전 | 511 | ||
| 5702 |
AMDbest
|
13년 전 | 1424 | |
| 5701 |
|
13년 전 | 2894 | |
| 5700 | 13년 전 | 505 | ||
| 5699 |
미션임파썩을
|
13년 전 | 549 | |
| 5698 | 13년 전 | 634 | ||
| 5697 | 13년 전 | 551 | ||
| 5696 | 13년 전 | 459 | ||
| 5695 |
|
13년 전 | 713 | |
| 5694 | 13년 전 | 454 | ||
| 5693 | 13년 전 | 983 | ||
| 5692 | 13년 전 | 953 | ||
| 5691 |
쉽다zzz
|
13년 전 | 719 | |
| 5690 | 13년 전 | 475 | ||
| 5689 | 13년 전 | 637 | ||
| 5688 | 13년 전 | 1416 | ||
| 5687 | 13년 전 | 468 | ||
| 5686 | 13년 전 | 2453 | ||
| 5685 |
AMDbest
|
13년 전 | 2158 | |
| 5684 | 13년 전 | 2038 | ||
| 5683 | 13년 전 | 1370 | ||
| 5682 |
AMDbest
|
13년 전 | 708 | |
| 5681 | 13년 전 | 3816 | ||
| 5680 |
|
13년 전 | 1685 | |
| 5679 | 13년 전 | 2094 | ||
| 5678 |
|
13년 전 | 533 | |
| 5677 |
mobiler
|
13년 전 | 466 | |
| 5676 | 13년 전 | 1609 | ||
| 5675 | 13년 전 | 591 | ||
| 5674 |
PHPㅡASP프로그래머
|
13년 전 | 1824 | |
| 5673 |
PHPㅡASP프로그래머
|
13년 전 | 1493 | |
| 5672 |
PHPㅡASP프로그래머
|
13년 전 | 1284 | |
| 5671 |
PHPㅡASP프로그래머
|
13년 전 | 1213 | |
| 5670 |
PHPㅡASP프로그래머
|
13년 전 | 4613 | |
| 5669 | 13년 전 | 3051 | ||
| 5668 | 13년 전 | 1414 | ||
| 5667 | 13년 전 | 498 | ||
| 5666 | 13년 전 | 1146 | ||
| 5665 |
Darby
|
13년 전 | 1610 | |
| 5664 | 13년 전 | 1342 | ||
| 5663 | 13년 전 | 1128 | ||
| 5662 | 13년 전 | 792 | ||
| 5661 | 13년 전 | 454 | ||
| 5660 | 13년 전 | 844 | ||
| 5659 | 13년 전 | 711 | ||
| 5658 | 13년 전 | 532 | ||
| 5657 | 13년 전 | 536 | ||
| 5656 | 13년 전 | 991 | ||
| 5655 | 13년 전 | 437 | ||
| 5654 | 13년 전 | 390 | ||
| 5653 |
졸린다젠장
|
13년 전 | 480 | |
| 5652 |
|
13년 전 | 398 | |
| 5651 | 13년 전 | 1028 | ||
| 5650 | 13년 전 | 725 | ||
| 5649 | 13년 전 | 2236 | ||
| 5648 | 13년 전 | 480 | ||
| 5647 | 13년 전 | 757 | ||
| 5646 | 13년 전 | 1493 | ||
| 5645 | 13년 전 | 679 | ||
| 5644 | 13년 전 | 615 | ||
| 5643 |
|
13년 전 | 573 | |
| 5642 |
쿠마하우스
|
13년 전 | 685 | |
| 5641 |
goaway
|
13년 전 | 1084 | |
| 5640 |
쿠마하우스
|
13년 전 | 647 | |
| 5639 | 13년 전 | 674 | ||
| 5638 |
쿠마하우스
|
13년 전 | 998 | |
| 5637 | 13년 전 | 824 | ||
| 5636 | 13년 전 | 1416 | ||
| 5635 |
goaway
|
13년 전 | 910 | |
| 5634 |
lllolll
|
13년 전 | 422 | |
| 5633 | 13년 전 | 967 | ||
| 5632 | 13년 전 | 4273 | ||
| 5631 | 13년 전 | 576 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기