芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/js/printcoupon.js
jQuery(document).ready(function($) { 'use strict'; //Print function jQuery.fn.print=function(){var is_chrome = Boolean(window.chrome); if(this.length>1)return void this.eq(0).print();if(this.length > 0){var t="printer-"+(new Date).getTime(),o=$("
");o.css("width","1px").css("height","1px").css("position","absolute").css("left","-9999px").appendTo($("body:first"));var i=window.frames[t],e=i.document,n=$("
").append("");e.open(),e.write(''),e.write(""),e.write(""),e.write('
'),e.write("
"),e.write(document.title),e.write("
"),e.write(n.html()),e.write(""),e.write(this.html()),e.write(""),e.write(""); if (is_chrome) {setTimeout(function(){e.close(),i.focus(),i.print(),o.remove()},254);}else{e.close(),i.focus(),i.print(),setTimeout(function(){o.remove()},6e4);} }}; $(document).on("click", "span.printthecoupon", function(e){ e.preventDefault(); var printid = $(this).data('printid'); $("#printcoupon" + printid ).print(); }); });