最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

onbeforeprint Event

Internet Development Index

Fires on the object before its associated document prints or previews for printing.

Syntax

Inline HTML<ELEMENT onbeforeprint = "handler" ... > All platforms
Event propertyobject.onbeforeprint = handlerJScript only
object.onbeforeprint = GetRef("handler")Visual Basic Scripting Edition (VBScript) 5.0 or later only
Named script <SCRIPT FOR = object EVENT = onbeforeprint> Internet Explorer only

Event Information

BubblesNo
CancelsNo
To invoke
  • Choose Print or Print Preview from the File menu in Microsoft® 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 choose Print from the File menu.
  • From Windows Explorer, right-click on an .htm file and choose Print.
Default action Prints the document associated with the object for which the event is specified.

Event Object Properties

Although event handlers in the DHTML Object Model do not receive parameters directly, a handler can query an event object for data.

Available Properties

altKey Sets or retrieves a value that indicates the state of the ALT key.
altLeft Sets or retrieves a value that indicates the state of the left ALT key.
button Sets or retrieves the mouse button pressed by the user.
cancelBubble Sets or retrieves whether the current event should bubble up the hierarchy of event handlers.
clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
ctrlKey Sets or retrieves the state of the CTRL key.
ctrlLeft Sets or retrieves the state of the left CTRL key.
returnValue Sets or retrieves the return value from the event.
screenX Retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.
screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.
shiftKey Sets or retrieves the state of the SHIFT key.
shiftLeft Retrieves the state of the left SHIFT key.
srcElement Sets or retrieves the object that fired the event.
type Sets or retrieves the event name from the event object.
x Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.
y Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.

Remarks

Use this event to modify the document just before it prints or previews for printing. In most cases it is used to make all the information on the page visible just before printing.

Use the event in conjunction with the onafterprint event to undo the changes made to the document in the onbeforeprint event.

Example

This example uses the onbeforeprint to make all hidden sections of the page visible just before the page prints. The onafterprint event is processed after the page prints to return the document to its original state.

function window.onbeforeprint()
{
// Walk through all the elements in the document with
// CLASS="collapsed" and set it to "expanded" just for printing.
var coll = document.all.tags("DIV");
if (coll!=null)
{
for (i=0; i<coll.length; i++)
if (coll[i].className == "collapsed")
{
coll[i].className = "expanded";
// After printing, make sure to set CLASS="collapsed"
// only for those that were expanded just for printing.
coll[i].bExpandedForPrinting = true;
}
else if (coll[i].className == "expanded")
coll[i].bExpandedForPrinting = false;
}
}
function window.onafterprint()
{
// Walk through all the elements in the doc with CLASS="expanded"
// and set it to "collapsed" if expanded just for
// printing.
var coll = document.all.tags("DIV");
if (coll!=null)
{
for (i=0; i < coll.length; i++)
if ((coll[i].className == "expanded") &&
(coll[i].bExpandedForPrinting))
{
coll[i].className = "collapsed";
coll[i].bExpandedForPrinting = false;
}
}
}
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this event.

Applies To

window, BODY, FRAMESET

See Also

onafterprint, print
和平县| 芦溪县| 绥化市| 铁岭县| 涿州市| 平舆县| 贵港市| 视频| 汨罗市| 沿河| 云梦县| 荔浦县| 邢台市| 红桥区| 乐清市| 茂名市| 许昌县| 舒城县| 泸水县| 资阳市| 德兴市| 哈尔滨市| 卢氏县| 寿光市| 舒兰市| 时尚| 高州市| 抚顺县| 徐水县| 从化市| 唐河县| 曲靖市| 和林格尔县| 钟祥市| 东乌| 肥城市| 武功县| 铁力市| 潜江市| 思南县| 甘肃省|