Reputation: 35
I'd like to have canvas interaction through a different HTML element.
I have been using the particles.js package and I added an overlapping HTML element to it. The overlapping element has no background (i.e. background: none
) and only some text. However, the background of the overlapping element still blocks any canvas interaction.
I expect that the dots make connecting lines with the cursor both inside and outside of the box.
Here is an interaction:
Here is no interaction, where I would want it:
A minimum working example can be found here. This example has been adapted from another codepen in order to show the problem clearly.
Is there any way to get an interaction through overlapping HTML elements?
Upvotes: 0
Views: 376
Reputation: 35
As markE mentioned in the comments.
Setting pointer-events: none
makes it possible to sent canvas interaction through an overlapping element.
edit: I have added the working code to the minimum working example. One only needs to uncomment it in the css.
Upvotes: 1