Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Impossible to set the rule "pointer-events" through JS or jQuery?

I've to manipulate the interaction with an element in runtime, making it invisible and "no interactible".. The rule that can accomplish the second, is "pointer-events: none"

The problem is that it doesn't recognized from JS or jQuery... why?

like image 549
Sonia Avatar asked Mar 08 '13 13:03

Sonia


1 Answers

I don't think I understand the question, but (using jQuery)

$( document.body ).css( 'pointer-events', 'none' );

will work just fine for supporting browsers (ignoring any pointer event). However, if you remove / hide the element, pointer events will of course also no longer work if you hide it by

display: none
like image 147
jAndy Avatar answered Oct 17 '22 00:10

jAndy