Top

À¥¿¡¼­ div¸¸ ÇÁ¸°ÅÍ Ãâ·ÂÇϱâ | Web-Programing
¾ÈÁöÈì (hoomiyam) | Editor | 2014/06/26 09:50:31 | Á¶È¸:10118

  1. <div id='printArea'> hoooooo </div>
  2. <input type='button' name='pBtn' id='pBtn' value='ÀμâÇϱâ' onClick="javascript:pageprint('printArea');">

À§ÀÇ °ø°£¸¸ Ãâ·Â½Ã


  1. <script>
  2. var initBody;
  3. function beforePrint(mapId)
  4. {
  5.     initBody = document.body.innerHTML;
  6.     document.body.innerHTML = mapId.innerHTML;
  7. }
  8. function afterPrint()
  9. {
  10.     document.body.innerHTML = initBody;
  11. }
  12. function pageprint(mapId)
  13. {
  14.     window.onbeforeprint = beforPrint(mapId);
  15.     window.onafterprint = afterPrint();
  16.     window.print();
  17. }

 

¾îÁ¦ ÇÁ¸°Æ® ÀμâÇÏ´Â°É Ã£´Âµ¥ Æ˾÷Àμ⸸ Àܶ೪¿À°í ¾î¶²°Ç È­¸éÀÌ ±×³É ¸®ÇÁ·¹½¬ µÇ°í 

°á±¹ ±¦ÂúÀº ¼Ò½º ãÀ½ Ãâó°¡ ±â¾ïÀÌ ¾È³²;

¼Ò½º ½áº¸·Á´Ï ÇÔ¼öÈ­°¡ ¾ÈµÇÀÕ¾î Àç»ç¿ëÀ» ¸øÇؼ­ ÇÔ¼öÈ­ ½ÃÅ´.

div id °ªÀ» pageprint() ÇÔ¼öÀÇ ÆĶó¹ÌÅÍ·Î ³Ñ±â¸é µÊ. ³¡!

 

 

°øÀ¯Çϱâ
°øÀ¯Çϱâ
0
0
0


´ñ±ÛÀ» ºÒ·¯¿À´Â ÁßÀÔ´Ï´Ù.
¡ã ÀÌÀü±Û Ä«Ä«¿ÀÅå¿¡ ¸µÅ© °øÀ¯Çϱâ ! ½ÅÀå¹Ì (shinjm) 2014-07-14 11:46:54
¡å ´ÙÀ½±Û [CSS] ºê¶ó¿ìÀú ¹öÀüº° CSSÇÙ ±è°æÈÆ (admin) 2014-06-24 11:38:46