Why is filter(drop-shadow) causing my SVG to disappear in Safari?

前端 未结 6 764
臣服心动
臣服心动 2020-12-06 06:04

I am developing an app using D3.js. I was sidetracked for a while, and recently came back to it. Today I found that, though it worked fine in the past, the SVG map in the ap

6条回答
  •  长情又很酷
    2020-12-06 06:38

    In my case, I was using an SVG Filter, so I couldn't really apply the CSS solution. Instead, I was able to get the SVG to show up by applying a CSS transformation via Javascript after the page loads. Here's an example in plain JS:

    setTimeout(function(){
     document.getElementById("svg-element").style.display = "block";
    },10);
    

    If you want to know if this will work, see if the SVG shows up after you resize the browser or modify a CSS style rule using the inspector.

提交回复
热议问题