Coder Social home page Coder Social logo

Insert jquery on iframe? about printthis HOT 10 CLOSED

jasonday avatar jasonday commented on August 18, 2024
Insert jquery on iframe?

from printthis.

Comments (10)

jasonday avatar jasonday commented on August 18, 2024

The iframe should never need jquery, as there is zero interactivity within
the iframe itself. It is used for printing only. If you need additional
elements, or do run a function before printing, then you can use a print
stylesheet in conjunction with my plugin to show/hide elements - or in the
print function, add whatever jquery you need.

On Wed, Aug 21, 2013 at 9:24 AM, MAAARKIN [email protected] wrote:

Is possible I put jquery code on this iframe? because this plugin make
everything i need, but sometimes i need insert "${selector}.append on my
html but if i make this don't print the append


Reply to this email directly or view it on GitHubhttps://github.com//issues/16
.

from printthis.

MAAARKIN avatar MAAARKIN commented on August 18, 2024

hmm, i'm talking this because i make this code:

$('#printButton').hide();
$(".insidePrint").printThis({
debug: false,
importCSS: false,
printContainer: true,
loadCSS: "path/do/css",
pageTitle: "Teste",
removeInline: true
});
$('#printButton').show();

and the div printButton is printed

from printthis.

jasonday avatar jasonday commented on August 18, 2024

You just need to wrap it all - pseudocode below

$('#myButton').on('click', function() {
$('#printButton').hide();
$(".insidePrint").printThis({
debug: false,
importCSS: false,
printContainer: true,
loadCSS: '',
pageTitle: "Teste",
removeInline: true
});
$('#printButton').show();
});

On Wed, Aug 21, 2013 at 9:40 AM, MAAARKIN [email protected] wrote:

hmm, i'm talking this because i make this code:

$('#printButton').hide();
$(".insidePrint").printThis({
debug: false,

importCSS: false,
printContainer: true,

loadCSS: '',
pageTitle: "Teste",

removeInline: true
});
$('#printButton').show();

and the div printButton is printed


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-23017477
.

from printthis.

jasonday avatar jasonday commented on August 18, 2024

Either that, or in a css file specify a print media query that hides the
button. Easy peasy.

On Wed, Aug 21, 2013 at 9:57 AM, Jason Day [email protected] wrote:

You just need to wrap it all - pseudocode below

$('#myButton').on('click', function() {
$('#printButton').hide();
$(".insidePrint").printThis({
debug: false,
importCSS: false,
printContainer: true,
loadCSS: '',
pageTitle: "Teste",
removeInline: true
});
$('#printButton').show();
});

On Wed, Aug 21, 2013 at 9:40 AM, MAAARKIN [email protected]:

hmm, i'm talking this because i make this code:

$('#printButton').hide();
$(".insidePrint").printThis({
debug: false,

importCSS: false,
printContainer: true,

loadCSS: '',
pageTitle: "Teste",

removeInline: true
});
$('#printButton').show();

and the div printButton is printed


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-23017477
.

from printthis.

MAAARKIN avatar MAAARKIN commented on August 18, 2024

hmm, i think that better i make in css this div display none. xD

@media print #thisdiv display none...

but ok, other thing, i'm using countdown plugin in my app, when i call $(".insidePrint").printThis({...}), open dialog to print page, everything ok, but the countdown stop time, only continue when i close de dialog kk, but if i click on right-click and click on print page open dialog and the time of countdown keep going

do you know why this?

from printthis.

jasonday avatar jasonday commented on August 18, 2024

You would need to add an option to stop the countdown when you click print,
but you may run into some challenges with that, as the page is still
active.

On Wed, Aug 21, 2013 at 10:15 AM, MAAARKIN [email protected] wrote:

hmm, i think that better i make in css this div display none. xD

@media https://github.com/media print #thisdiv display none...

but ok, other thing, i'm using countdown plugin in my app, when i call
$(".insidePrint").printThis({...}), open dialog to print page, everything
ok, but the countdown stop time, only continue when i close de dialog kk,
but if i click on right-click and click on print page open dialog and the
time of countdown keep going


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-23019952
.

from printthis.

MAAARKIN avatar MAAARKIN commented on August 18, 2024

but i don't want stop time, do contrary, i want the countdown don't stop, but i don't know why the countdown stop when i call the printThis.

when i click print, and dialog is closed the countdown continues

;/

from printthis.

jasonday avatar jasonday commented on August 18, 2024

Ah. Sorry - wasn't sure what you were asking. When the browser initiates the print window, it halts everything. The only way around that would be to set a variable with the start time, and when print is done compare the current time to the start time.

However, this is not a printThis() bug. So I am going to close this, however if you have further questions please feel free to continue to ask them in this thread.

from printthis.

MAAARKIN avatar MAAARKIN commented on August 18, 2024

i say that because when i print using right-click > print the countdown don't stop, but i don't know alot about jquery, but i will see that now and try fix.

from printthis.

jasonday avatar jasonday commented on August 18, 2024

My plugin does not work with right-click, browser menu or control-p printing. You need a print stylesheet for those scenarios. http://alistapart.com/article/goingtoprint/

from printthis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.