onafterprint
特性为
WindowEventHandlers
混合
EventHandler
为处理
afterprint
events for the current window. These events are raised after the user prints, or if they abort the print dialog.
beforeprint
and
afterprint
events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. In general, you should prefer the use of a
@media print
CSS at-rule, but it may be necessary to use these events in some cases.
window.addEventListener("afterprint", function(event) { ... });
window.onafterprint = function(event) { ... };
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'onafterprint' in that specification. |
实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onafterprint
|
Chrome 63 | Edge 12 | Firefox 6 | IE Yes | Opera 50 | Safari 13 | WebView Android 63 | Chrome Android 63 | Firefox Android ? | Opera Android 46 | Safari iOS 13 | Samsung Internet Android 8.0 |
完整支持
兼容性未知