在 Firefox 中打印字段集
我一直在页眉中的现有项目中添加一些新的CSS(使用media =“print”)。一切都很顺利,(这一次!)IE 给出了很好的、预期的结果,但 Firefox 没有...
问题是我有一个包含很多字段的字段集,而 Firefox 完全拒绝(即使在最新版本中)允许在字段集中进行分页。这意味着任何不能在一页上显示的内容都会丢失...
我发现 Mozilla 网站上承认了该错误,该网站已开放 3 年 - https://bugzilla.mozilla.org/show_bug.cgi?id=471015 - 但找不到任何合理的解决方法...
在我考虑删除之前有任何建议字段集或类似的?
谢谢, 戴夫
I've been adding some new css to an existing project (using media="print") in the page header. It's going smooth and (for once!) IE is giving nice, expected results, but Firefox does not...
The problem is that I have a fieldset which contains a lot of fields, and Firefox completely refuses (even in the latest version) to allow a page break inside the fieldset. This means anything that doesn't fit on one page is lost...
I've found the bug acknowledged on the mozilla website which has been open for 3 years - https://bugzilla.mozilla.org/show_bug.cgi?id=471015 - but can't find any reasonable workaround...
Any suggestions before I look to remove fieldsets or similar?
Thanks,
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我的 FF 的 JQuery 解决方案:
My JQuery solution for FF:
正如我所猜测的,它在最新的 Nightly 中仍然存在问题。
您可以尝试执行类似于 IE Print Protector (又名 广泛使用html5shiv)。
http://www.iecss.com/print-protector/#how-it -作品
Firefox 现在支持
onbeforeprint
。因此,当
onbeforeprint
被触发时,您可以更改div
的fieldset
等。我不确定这有多可行,而且听起来确实很复杂。
As I guessed, it's still broken in the latest Nightly.
You could try to do something similar to IE Print Protector (aka the widely used html5shiv).
http://www.iecss.com/print-protector/#how-it-works
Firefox now supports
onbeforeprint
.So, when
onbeforeprint
is fired, you could change thefieldset
s fordiv
s, or something.I'm not sure how viable this is, and it sure sounds complicated.
看看我刚刚写的这个 jQuery hack 来解决这个问题,我想我会分享,尽管我有点晚了。我相信您可以将“printEnclosure”更改为 HTML 标记,并且末尾的 CSS 显然是可选的。
Check out this jQuery hack I just wrote to solve this issue, figured I'd share even though I'm a bit late. You can change "printEnclosure" to an HTML tag I believe and the CSS at the end is obviously optional.
由于 JQuery 现在并不常见,这里有一个完整的 JavaScript 解决方案:
Since JQuery is not as common nowadays, here is a full JavaScript solution: