Created
July 26, 2017 09:16
-
-
Save sourovroy/23b1bd7781f3db267229c4971ad882b4 to your computer and use it in GitHub Desktop.
Print a element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PrintContent = jQuery("div.col-sm-12 > div.inner"), | |
PrintContentClone = PrintContent.clone(); | |
$('<iframe>', { | |
name: 'myprintiframe', | |
class: 'productPrintFrame' | |
}) | |
.appendTo('body') | |
.contents().find('body') | |
.append(PrintContentClone); | |
window.frames['myprintiframe'].focus(); | |
window.frames['myprintiframe'].print(); | |
setTimeout(function(){ $(".productPrintFrame").remove(); }, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment