简体   繁体   English

如何使用javascript打印灯箱

[英]how to print the lightbox using javascript

I have the some text loaded in light box with background faded. 我将一些文本加载到灯箱中,背景逐渐褪色。

i want the print button in the light box so that when user click on that only the contents of light box is printed and printer box opens up. 我想要灯箱中的打印按钮,以便在用户单击时仅打印灯箱中的内容,然后打开打印机箱。

How to do that?? 怎么做??

Have you tried using a print stylesheet? 您是否尝试过使用打印样式表?

Basically when it prints use a css stylesheet to hide everything that is not in the lightbox. 基本上,在打印时,请使用CSS样式表隐藏灯箱中未包含的所有内容。

CSS Design: Going to Print CSS设计:要印刷

When you open up your lightbox you want to add a print stylesheet that hides everything else but what is in the lightbox. 当您打开灯箱时,您要添加一个打印样式表,该样式表将隐藏灯箱中的所有内容。 When you close the lightbox remove that stylesheet. 关闭灯箱时,请删除该样式表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM