حدد محتوى طباعة في صفحة بسبب احتياجات المشروع.
التقط ما تريد طباعته باستخدام طبقة DIV. على سبيل المثال:
نسخة الكود كما يلي:
<!-إشعار نقل مسائل الالتماس يبدأ->
<div id = "itemvrbjform" style = "font-family:" Song Song "،" Song Style "؛ Font-Size: 18px ؛ Margin-Top: 290px ؛"
<viv>
<div style = "float: right ؛ hargin -top: -40px ؛"> (رقم المعلومات: $ {zjxfiteMuser.acceptedno}) </div>
<div id = "title" style = "Margin-Top: 40px ؛"
$ {zjxfitemuser.username}: (اسم الملتمس) <br/>
<span id = "itemvrbjtime"> </span> ، قبلت هذه الوكالة (أو الوحدة) $ {zjxfitemuser.subject} مسائل التماس التي اقترحتها (أو أنت) وفقًا للقانون ،
تقع مسألة الالتماس ضمن نطاق سلطة XXX وفقًا للأحكام ذات الصلة "Letters and Petition" ، وقد سلمت هذه الوكالة المواد ذات الصلة على XXX على XX ، XXX ، للاتصال به في الوقت المناسب. . <br/>
اسمحوا لي أن أعرف هنا. <br />
<div style = "hargin-top: 50px ؛ الهامش اليمين: 20px ؛ تعويم: يمين ؛"> (sub-sub-name} ختم خاص أو ختم رسمي) </div>
<div style = "margin-top: 90px ؛ margin-right: -190px ؛ float: right ؛"> <span id = "itemVrbjendtime"> </span> </viv>
</div>
</div>
<!-إشعار نقل مسائل الالتماس نهاية->
ليست هناك حاجة للطباعة في الوسط ، ويتم تضمينها أيضًا مع طبقة DIV. استخدام أنماط CSS. الإشارة إلى الفئة = "noprint" في طبقة لا تتطلب الطباعة تتم
نسخة الكود كما يلي:
<style type = "text/css" media = "print">
.noprint {الرؤية: لا شيء ؛}
</style>
رمز JS:
ملاحظة: عند اختيار الطباعة ، سيتم فقدان النمط.
نسخة الكود كما يلي:
$ (function () {
$ ("#print"). انقر فوق (function () {
var html = window.document.body.innerhtml ؛
orportcss ("itemVrBJform" ، html) ؛
}) ؛
// نمط الاستيراد لاختيار الطباعة
صادرات الدالة (formname ، htmlinfo) {
var css = "<link href =/" " + baseurl +"/zjxf/common/css/common.css/"type =/" text/css/"rel =/" stylesheet/"/>" +
"<link href =/" " + baseurl +"/zjxf/common/css/table.css/"type =/" text/"css/" rel =/"stylesheet/"/> " +
"<link href =/" " + baseurl +"/zjxf/common/css/form.css/"type =/" text/"css/" rel =/"stylesheet/"/> " +
"<link href =/" " + baseurl +"/zjxf/common/css/tab.css/"type =/" text/"css/" rel =/"stylesheet/"/> " +
"<link href =/" " + baseurl +"/zjxf/common/css/print.css/"type =/" text/"css/" rel =/"stylesheet/"/> "؛
$ (CSS) .Appendto ("#" + formName) ؛
window.document.body.innerhtml = $ ("#" + formName) .html () ؛
window.print () ؛
window.document.body.innerhtml = htmlinfo ؛
}
}) ؛
هذا يسمح لكلا من طباعة الاختيار الجزئي والطباعة الجزئية غير المحددة