如何在打印后禁用打印按钮 [英] how to disable print button after printing

查看:107
本文介绍了如何在打印后禁用打印按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在我的网页上显示一个图像,在图像下方我给出了打印此页面的打印按钮。但在打印页面后,这个打印按钮也会在打印页面上显示。如果我在打印后禁用此按钮,它们也不会在打印页面上显示在网页上。



但我想在打印后再次在网页上显示此按钮,



请帮帮我,给我一个解决方案。





谢谢。



I show the one image on my webpage, and below the image i give the ''print'' button for printing this page. but after the printing the page this ''print'' button also visible on printing page. if i disable this button after printing they not display on printing page also on webpage.

but i want again this button on webpage after printing,

please help me, give me one solution for this.


Thank you.

推荐答案

按打印按钮时,使用JavaScript将打印按钮的显示属性设置为隐藏。当打印页面关闭并返回主页面时,请刷新它并显示按钮。



When you press the ''print'' button, set the display property of the print button as hidden using JavaScript. When the print page is closed and you are back to main page, refresh it and show back the button.

//hide
document.getElementById("myPrintButton").style.display = "hidden";
// show
document.getElementById("myPrintButton").style.display = "block";


这篇关于如何在打印后禁用打印按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆