# node-iframe-event-bubble **Repository Path**: linuxmail/node-iframe-event-bubble ## Basic Information - **Project Name**: node-iframe-event-bubble - **Description**: iframe 内鼠标事件和键盘事件冒泡。 支持 ctrl, shift, alt, meta 冒泡 - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-12-24 - **Last Updated**: 2025-03-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: event, JavaScript, iframe, Dom ## README # node-iframe-event-bubble ## 说明 网址: https://gitee.com/linuxmail/node-iframe-event-bubble iframe 内鼠标事件和键盘事件冒泡。 支持 ctrl, shift, alt, meta 冒泡 ## 用法 ``` import iframeEventBubble from "iframe-event-bubble"; // iframeElement 是 iframe 的 Element,不是 iframe 内的 document,第二个参数默认是 true // true: 启用冒泡, false: 关闭冒泡 // 具体的事件见方法名,顾名思义即可 iframeEventBubble.bubbleClick(iframeElement, true/false); iframeEventBubble.bubbleDblclick(iframeElement, true/false); iframeEventBubble.bubbleMousedown(iframeElement, true/false); iframeEventBubble.bubbleMouseup(iframeElement, true/false); iframeEventBubble.bubbleMouseover(iframeElement, true/false); iframeEventBubble.bubbleMouseout(iframeElement, true/false); iframeEventBubble.bubbleMouseenter(iframeElement, true/false); iframeEventBubble.bubbleMouseleave(iframeElement, true/false); iframeEventBubble.bubbleKeydown(iframeElement, true/false); iframeEventBubble.bubbleKeyup(iframeElement, true/false); iframeEventBubble.bubbleKeypress(iframeElement, true/false); ```