jquery PrintArea 实现票据的套打功能(代码)
套打就是指不打印表单上的表结构和固定的文言,只把会变化的数据打印出来,下面的例子就是不把name和name2打印出来,只把aaa和bbb打印出来。
1.代码
<html> <head> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript" src="jquery.PrintArea.js"></script> </head> <body> <table> <tr> <td> name: </td> <td></td> </tr> <tr> <td> name2: </td> </tr> </table> <div class="my_show"> <div style="position: absolute; left: 60px; top: 10px;"> aaa </div> <div style="position: absolute; left: 60px; top: 35px;"> bbb </div> </div> <a href="javascript:;" rel="external nofollow" id="print" />打印</a> <script type="text/javascript"> $(document).ready(function() { $("#print").click(function() { $(".my_show").printArea() }) }); </script> </body> </html>
2.画面显示
3.打印结果
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17