SnapSVG: remove mask from element (expose)

I have JS code in which I use Snap SVG. At some point I use

element.attr({mask:maskelement});

In this fragment element, there maskelementare two elements inside my svg.

Now I want to remove the mask. What will be the correct code that achieves this?

+4
source share
2 answers

I found the answer here , although I think this is not the best answer.

Basically, you set the mask display property to none with the following code

maskelement.attr("display", "none");

Although SVG looks like a mask, it really does not remove the mask. I think there is a better answer.

+1
source

. -

element.attr('mask', null');

, :

element.node.removeAttribute('mask');
0

All Articles