asp.net.ph

onafterprint Event

DHTML Events


Fires on the object immediately after its associated document prints.

Syntax


Inline HTML <element onafterprint = "handler" ... > All platforms
Event property object.onafterprint = handler ECMA-262 Language Specification
Named script <script FOR=object EVENT = onafterprint> Internet Explorer® only

Remarks


Bubbles No
Cancels No
To invoke
  • Choose Print from the File menu in Internet Explorer.
  • Press CTRL + P.
  • Right-click anywhere on a page, and choose Print.
  • Right-click on a link on a page, and choose Print.
  • From Windows Explorer, select an .htm file, and then choose Print from the File menu.
  • From Windows Explorer, right-click on an .htm file, and then choose Print.
Default Action None

This event is usually used in conjunction with the onbeforeprint event. Whereas the onbeforeprint event gives the Web author an opportunity to make changes to the document just before it prints, the onafterprint event provides a means to undo those changes, reverting the document back to its pre-print state.

Event Object Properties

Although event handlers in the document object model do not receive parameters directly, the handler can query the event object for data.

Event Object Properties


Example

The following example demonstrates how the onafterprint event can be used to bring the document back to its pre-print state. In this case, since the onbeforeprint event handler made all currently hidden sections of the page visible for printing purposes, the onafterprint event is used to set those sections back to hidden.

Sample Code


Applies To

window, BODY, FRAMESET

See Also

onbeforeprint, print




Contents
HTML Elements
HTML Element Attributes
CSS Attributes
DOM Objects
DOM Object Properties
DOM Events Reference
DOM Methods Reference
DOM Collections Reference
 

Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph