Also, consider the fact that the ".setTimeout()" countdown will be "paused" and "resumed" if you leave the page and then return to it again using the "Back" button.
It is not a bad thing if you know the behaviour and code for that. -- Diego On Sun, Nov 27, 2011 at 3:27 AM, Michael Geary <[email protected]> wrote: > It doesn't seem surprising to me. Browsers generally wait until JavaScript > stops running before they reflow anything. > Take a simple jQuery example: > // Assume the body has a lot of HTML in it before these calls: > $('body').empty(); > $('body').html( 'Put some long bit of HTML code here' ); > This code should result in only a single reflow, not two. > I don't know about the print dialog specifically, but it seems that it could > be a similar situation. > Did you find that a very short timeout value (e.g. 0 or 1) in the > setTimeout() works reliably, or is it unreliable with a short timeout and > you have to use a longer timeout to make it work? If a short timeout makes > it work with complete reliability, then I'd say it's just the deferred > reflow I mentioned. If it only works with some longer timeout value, then > I'd be worried that it will not always work. > -Mike > > On Sat, Nov 26, 2011 at 6:02 PM, BlessYAHU <[email protected]> wrote: >> >> I have been trying to get printing from an iframe to work cross >> browser. Iframe content is from an external source (I own the >> external content). The only way I've gotten the entire contents to be >> printed is resize(enlargen) the frame for printing, call up the print >> dialog via print(), and then resize back to it's original size once >> the printing is done. In this solution, I have to put a settimeout >> around the print() function, or the print dialog will show before the >> frame is resized(enlargened). I also have to put a settimeout around >> resizing back to original size. >> >> It seems like the print is happening before the screen reflow is >> called, which is why the settimeout would be needed, but wanted to see >> if this seemed strange to anyone here. >> >> -- >> To view archived discussions from the original JSMentors Mailman list: >> http://www.mail-archive.com/[email protected]/ >> >> To search via a non-Google archive, visit here: >> http://www.mail-archive.com/[email protected]/ >> >> To unsubscribe from this group, send email to >> [email protected] > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
