Inspired by PrintArea and this stackoverflow comment
Fork (Github Project) | jQuery Plugin home page | Wiki | Issues (Report bugs)
Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html
$('SelectorToPrint').printElement();
$("selector").printElement({printMode:'popup'});
$("selector").printElement({pageTitle:'thisWillBeTheNameInThePrintersLog.html'});
$("selector").printElement(
{
overrideElementCSS:[
'thisWillBeTheCSSUsed.css',
{ href:'thisWillBeTheCSSUsedAsWell.css',media:'print'}]
});
$("selector").printElement(
{
printBodyOptions:
{
styleToAdd:'padding:10px;margin:10px;color:#FFFFFF !important;',
classNameToAdd : 'thisWillBeTheClassUsedAsWell'
}
});
$("selector").printElement(
{
leaveOpen:true,
printMode:'popup'
});
$("selector").printElement(
{
iframeElementOptions:
{
styleToAdd:'position:absolute;width:0px;height:0px;bottom:0px;',
classNameToAdd : 'thisWillBeTheClassUsedAsWell'
}
});