javascript event 属性

本文详细介绍了鼠标和键盘事件中常见的属性及其含义,如位置信息(layerX, layerY, pageX, pageY, screenX, screenY)、鼠标按键与键盘键值(which)、修饰键(modifiers)等,为开发者理解并利用这些事件提供了实用指南。

target String representing the object to which the event was originally sent. (All events)

type String representing the event type. (All events)

data Returns an array of strings containing the URLs of the dropped objects. Passed with the DragDrop event.

height Represents the height of the window or frame.

layerX Number specifying either the object width when passed with the resize event, or the cursor's horizontal position in pixels relative to the layer in which the event occurred.Note that layerX is synonymous with x.

layerY Number specifying either the object height when passed with the resize event, or the cursor's vertical position in pixels relative to the layer in which the event occurred. Note that layerY is synonymous with y.

modifiers String specifying the modifier keys associated with a mouse or key event. Modifier key values are: ALT_MASK, CONTROL_MASK, SHIFT_MASK, and META_MASK.

pageX Number specifying the cursor's horizontal position in pixels, relative to the page.

pageY Number specifying the cursor's vertical position in pixels relative to the page.

screenX Number specifying the cursor's horizontal position in pixels, relative to the screen.

screenY Number specifying the cursor's vertical position in pixels, relative to the screen.

which Number specifying either the mouse button that was pressed or the ASCII value of a pressed key. For a mouse, 1 is the left button, 2 is the middle button, and 3 is the right button.

width Represents the width of the window or frame. 

转载于:https://my.oschina.net/oncereply/blog/7985

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值