14

Let's say I have a graphical effect that I want to be overlaying HTML-Text. This Element shouldn't interfere with the usability of the site, it wouldn't have any interactive purpose. Is it possible to disable all Mouse Interaction on a certain html-object, for example on a canvas, so that I could still interact (klick on links, select text, ...) with the underlying objects?

that would be great!

Phrogz
  • 296,393
  • 112
  • 651
  • 745
rassoh
  • 545
  • 1
  • 5
  • 21

1 Answers1

24

Using the pointer-events:none CSS property (implemented first in SVG, on its way to HTML) allows you to turn off hit detection for an element.

This is non-standard as of this writing and only supported in a subset of browsers. (Firefox and Safari/Chrome, but not Opera or IE.) Other than this, there is no way to do this.

Here's the in-progress CSS3 reference for this property.

See also this question: CSS pointer-events property alternative for IE.

Community
  • 1
  • 1
Phrogz
  • 296,393
  • 112
  • 651
  • 745
  • thanks for the hint! I checked it, you are right, safari and ff can do it, opera can't... I can't wait for this to become standard! – rassoh Jan 24 '11 at 14:28
  • @Gaggo You are welcome. As you are new to Stack Overflow, know that you should upvote (upwards triangle) any answers that you feel have been useful, and accept (checkmark) the one answer (if any) that best answers your question. I'm not suggesting you need to accept mine--it is often good to wait a few days to see if a better answer comes along, especially when answers so far are "it is not possible"--but it helps other users, the site, the reputation of those donating their time, and your reputation to participate in highlighting good answers. – Phrogz Jan 24 '11 at 16:04
  • @ Progz Thanks for the instructions, I'm not quite familiar with the system yet... Can you also tell me where I can activate an email notification, if anyone answers to my post? – rassoh Jul 07 '11 at 16:34
  • @Gaggo There is no email notification for comments. See http://meta.stackexchange.com/questions/42436/email-notification-about-comments/42439#42439 – Phrogz Jul 07 '11 at 16:37