局部打印插件 jquery.PrintArea.js
2020-12-13 02:40
标签:style blog class code java tar 局部打印插件 jquery.PrintArea.js,搜素材,soscw.com 局部打印插件 jquery.PrintArea.js 标签:style blog class code java tar 原文地址:http://www.cnblogs.com/zhangs1986/p/3719396.html(function ($) {
var printAreaCount = 0;
$.fn.printArea = function () {
var ele = $(this);
var idPrefix = "printArea_";
removePrintArea(idPrefix + printAreaCount);
printAreaCount++;
var iframeId = idPrefix + printAreaCount;
var iframeStyle = ‘position:absolute;width:0px;height:0px;left:-500px;top:-500px;‘;
iframe = document.createElement(‘IFRAME‘);
$(iframe).attr({
style: iframeStyle,
id: iframeId
});
document.body.appendChild(iframe);
var doc = iframe.contentWindow.document;
$(document).find("link").filter(function () {
return $(this).attr("rel").toLowerCase() == "stylesheet";
}).each(
function () {
doc.write(‘‘);
});
doc.write(‘
原文:http://www.cnblogs.com/beijia/archive/2012/07/09/printArea.html
上一篇:Python切片