【发布时间】:2019-05-14 04:12:26
【问题描述】:
我的网站上有一个 svg stroke-dasharray 过渡元素悬停在元素上,问题是我在元素上悬停 4-5 次,页面崩溃/变得无响应。最终我不得不杀死页面!有人知道这个问题吗?
div{
max-width: 200px;
background: tomato;
text-align:center;
}
svg {
max-width: 100px;
fill:none;
stroke: #212121;
stroke-width: 1;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dashoffset: 0;
stroke-dasharray: 0;
transition-duration: 850ms;
}
div:hover svg {
stroke-dashoffset:0;
stroke-dasharray:73;
}
<div>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<path class="download_st0" d="M21,15v4c0,1.1-0.9,2-2,2H5c-1.1,0-2-0.9-2-2v-4"/>
<polyline class="download_st0" points="7,10 12,15 17,10 "/>
<line class="download_st0" x1="12" y1="15" x2="12" y2="3"/>
</svg>
</div>
【问题讨论】:
标签: html css svg css-transitions svg-animate