svg - 如何判断 SVG 何时完成渲染

标签 svg

我有一个 SVG,加载时间很短(大约 2-3)秒。那段时间,看起来有点好笑。无论如何,有没有办法告诉 SVG 何时完成渲染,以便我可以放置一个微调器或隐藏它或其他东西?

最佳答案

你说不出来。该限制是为了保障用户的安全。请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=608030有关何时考虑在 Firefox 中进行此操作的更详细说明,但其他 UA 会得出相同的结论,因此您不可能在任何 UA 中执行此操作。

来自引用的错误...

Doing anything conditionally on the visitedness of a link seems dangerous. I haven't tried this, but suppose the attacker wants to know if the user has been to example.com. An attacker could set the href of a hyperlink to example.com, then navigate to example.com in a hidden iframe. If a MozAfterPaint event fires on the document where the hyperlink lives, you'd know the user hasn't been to www.example.com yet. Otherwise, they have.

关于svg - 如何判断 SVG 何时完成渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10648693/

相关文章:

javascript - 如何使用 Javascript 动态更改 SVG 中的图像模式

javascript - 如何将viewbox的高度和宽度导出为网页的高度和宽度

javascript - D3 : Set filter flood-color based on data

html - 如何旋转 SVG 六 Angular 形?

javascript - d3.js 在追加时不返回动态构造的 html 元素

javascript - 如何在 Sencha Touch 中的 Google map 上的 svg 上添加触摸并按住事件

css - svg 模糊效果,设置特定颜色

html - 设置为背景的 SVG 线性渐变在 Edge 和 IE 中不起作用

qt - 在qt中呈现的svg中的多行居中文本

javascript - 在滚动条上绘制曲线虚线 SVG 路径