blog home

Another trick of CSS for printing in FF

Posted by Jen in coding front-end on November 12th, 2009

firefoxbugWorking on a printing CSS today, and I found when I tried to print or print preview the page in FF, it only prints/shows the first page, the rest are just blank. This issue only exists in FF browser, all others (IE6-8, Safari) are just fine. So what causes the problem and what’s the solution?

All because of this: overflow: hidden
As soon as I removed it, the print preview is good. However, this overflow:hidden is there for a reason, if you remove it, you have to work on the overflow issues. So printing or overfow? you gotta choose one, or if you are flexibile enough, work around the content to prevent it from being overflown.

Well, Firefox also has bugs… it’s the hard cold fact, so deal with it :)

Many reports about this issue in FF suport:

report 1,  report 2, report 3, look at the comments down there, they are really helpful.

be cautious when using window.opener

Posted by Jen in coding front-end on June 15th, 2009

I am talking about window.opener in JavaScript. By defining the attributes of this window.opener, you basically got to control some behavior of the parent window. That sounds cool but might be uncool in some situations as well. For example, when you do this, in order to show some page in the parent window:

<a href=”javascript:window.opener.location=’somewhere”>going somewhere in parent window</a>

It may not work at all, because from this current page, you have no control of where it came from. The user may get the URL of this current page, past it to the address bar directly and there will be no parent page of it all. In this situation, the link on this current page will go nowhere.

Well, just some a little issue I fixed from some badly coded website.