【发布时间】:2015-02-22 17:17:04
【问题描述】:
我有 svg 线:
<svg class="filling" width="500" height="10" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path data-over-line="" d="M90,5 L500,5" stroke="#e2e2e2" fill="transparent" stroke-width="4" style="stroke-dashoffset: 0px;"></path>
</svg>
我需要在滚动页面时逐渐填充不同的颜色。怎么做?
【问题讨论】:
-
你试过
window.onscroll吗? -
@micnic,我知道。我不知道什么机制可以帮助流畅地改变 svg 线的颜色。
-
您要更改填充还是描边?您在问题中提到了一个,在之前的评论中提到了一个。
-
SVG 滚动路径 ...(中风)cbron.github.io/blog/2013/12/30/…
-
SVG 填充滚动...codyhouse.co/gem/icons-filling-effect
标签: javascript jquery animation svg jquery-animate