Print preview close to return to the original modal dialog, close button can't use, bosses help
CodePudding user response:
From the top the top from the top
CodePudding user response:
function doPrint3 () {
//whether the iframe exists, does not exist, create the iframe
Var iframe=document. GetElementById (" print - the iframe ");
if(! The iframe) {
Var el=document. GetElementById (" printcontent ");
The iframe=document. The createElement method (" iframe ");
Var doc=null;
The iframe. SetAttribute (" id ", "print - the iframe");
The iframe. SetAttribute (' style ', 'position: absolute; Width: 0 px; Height: 0 px; Left: - 500 px; Top: - 500 px; ');
Document. The body. The appendChild (iframe);
Doc=iframe. ContentWindow. Document;
//here you can customize the style
//doc. Write (" & lt; LINK rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/css/print.css" & gt;" );
Doc. Write (' & lt; Div> '+ el. InnerHTML + & lt;/div> ');
Doc. The close ();
The iframe. ContentWindow. Focus ();
}
The iframe. ContentWindow. Print ();
If (the navigator userAgent. IndexOf (" MSIE ") & gt; 0 {
Document. Body. RemoveChild (iframe);
}
}
With the implementation of the above part printed page
CodePudding user response:
No points before the "print", "close" to close this?
CodePudding user response:
The