Reputation: 253
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?
Upvotes: 6
Views: 40588
Reputation: 11785
You can use the css pointer-events: none;
to allow events to go through. Also, like 1j01 commented, jquery will accept camelCase to get around the problem of dashes in the name:
$('.my-class').css({pointerEvents: "none"})
Upvotes: 8
Reputation: 236122
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
Upvotes: 21