Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

allowevents

这篇翻译不完整。请帮忙从英语翻译这篇文章

allowevents
Type: boolean
类型:boolean
If true, events are passed to children of the element. Otherwise, events are passed to the element only.
如果为真,事件向子元素传递。否则,事件只传递到当前元素。

On listitem and titlebar elements, mouse events normally do not get sent to their children; instead they are retargeted to the listitem and titlebar element itself. This means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list. By setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements.
在 listitemtitlebar 元素中,鼠标事件通常不发送给子元素;相反它们重定向到 listitemtitlebar 元素本身。这意味着,放置在listitem内部的元素并不响应事件,而点击鼠标仅仅是选择在列表中的元素。当设置allowevents属性为真时,这种特殊的响应被禁止,事件则被定向到其他相同的元素。

For menu, menuseparator, menuitem and treecol elements, as well as menu buttons, and the popup datepicker, mouse events are also retargeted to the element itself. However, the allowevents attribute is handled in a different way. Instead, the allowevents may be set to true on a descendant instead. This does the same thing in that it allows events to be targeted normally, but allows this to be different for each descendant.

This behavior is used for menus, for instance, to allow a menu button to behave as a menu when clicking on it, yet have part of the menu behave as a button. For the latter, the allowevents attribute is set to true to have a click on the child button receive events instead of targeting all events at the menu.

文档标签和贡献者

 此页面的贡献者: small-chair, ziyunfei, Cuimingda
 最后编辑者: small-chair,