A
A
AlexMorj2021-11-16 17:18:57
css
AlexMorj, 2021-11-16 17:18:57

How to bypass blocks?

The problem is the following. There is a canvas which in the background diverges with smoky paint when the cursor moves, but when you hover over a block, for example, an inscription, it stops working, only around. Here is an example How to do to ignore block i.e. so that the paint continues to follow the mouse behind the block continuously?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolai Shabalin, 2021-11-16
@AlexMorj

.text-take {
 ...
 pointer-events: none;
}

but this way you disable full interaction with the element. In general, you need to be careful with this property.

R
RAX7, 2021-11-16
@RAX7

If the c option pointer-events: none;is not suitable, then you can move the event handlers from the canvas to the body.

- canvas.addEventListener("mousemove", e => {
+ document.body.addEventListener("mousemove", e => {
// аналогично для других событий (touchmove, touchstart)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question