Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个目标是点击动物的 JavaScript 游戏。如果你做得对,我会在动物顶部显示一个带有星星的奖励层,但是当星星可见时,它们也会捕获触摸事件。有没有办法让触摸事件直接通过星星传递到下面的动物?
是的,设置pointer-events: none;在星星上,它们会像指针(和触摸)事件一样不可见。
pointer-events: none;