jQuery SVG, why can't I addClass?

前端 未结 15 2217
失恋的感觉
失恋的感觉 2020-11-22 02:25

I am using jQuery SVG. I can\'t add or remove a class to an object. Anyone know my mistake?

The SVG:



        
15条回答
  •  佛祖请我去吃肉
    2020-11-22 02:42

    One workaround could be to addClass to a container of the svg element:

    $('.svg-container').addClass('svg-red');
    .svg-red svg circle{
        fill: #ED3F32;
    }
    
    

提交回复
热议问题