V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
mt1992

一个解决了点击 iframe 无法触发 mouse 事件的库

  •  
  •   mt1992 · Apr 12, 2018 · 4490 views
    This topic created in 2937 days ago, the information mentioned may be changed or developed.

    众所周知,iframe 元素只能触发 load 事件。想想一下:在一个内嵌 iframe 的系统中导航栏中有 dropdown select 等组件,这些组件都有一个共性通过监听 click 或 mouseup 等事件来关闭弹出层,而 iframe 无法触发 mouse 事件,导致点击 iframe 区域的时候无法关闭弹出层,所以做一个库解决了这个问题。

    测试地址: https://jsfiddle.net/MT/eywraw8t/25950/

    github 仓库: https://github.com/1969290646/focus-outside

    cdn 地址: https://unpkg.com/[email protected]/lib/index.js

    ^_^ 既然都已经来了,就留下 star 呗。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6096 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:22 · PVG 10:22 · LAX 19:22 · JFK 22:22
    ♥ Do have faith in what you're doing.