js调用浏览器的打印功能后,当用户点击确定打印或取消打印时我怎么知道?
高洛峰
高洛峰 2016-10-31 10:20:21
0
5
1101

当用户点击确定打印或取消打印后,我需要将css样式换回原来的样式,卡在不知道JS如何描述点击确定或取消了,求大神指点一二!

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
P粉784700444

Have you solved it? I have encountered this problem recently and I want to know how I can know whether he clicked the "Print" or "Cancel" button

  • reply Have you solved it? I also encountered this problem
    P粉133424144 author 2022-11-09 11:13:36
  • reply Have you solved it?
    P粉704216360 author 2022-11-14 11:23:31
  • reply Have you solved it?
    P粉704216360 author 2022-11-14 11:23:53
三叔

不需要js做任何事情,使用专门给打印机写的css样式就可以了。使用媒体查询@media print来针对打印机写样式,当你点击打印时,这个css样式会起作用,当你取消打印时,就会恢复成原来的样式

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template