相关疑难解决方法(0)

已弃用的SMIL SVG动画替换为CSS或Web动画效果(悬停,单击)

按照这个主题:

Firefox 38-40 SMIL问题 - 速度非常慢(从1999年9月22日起在FF版本41中解决)

和这个主题:

意图弃用:SMIL

SVG标记'animateTransform'效果不佳.用CSS或CSS转换替换SMIL(animate标签)会很不错.

CONSOLE WARNING: Please use CSS animations or Web animations instead),
which would work fast on the latest versions of Firefox and Chrome.
Run Code Online (Sandbox Code Playgroud)

下一个Google Chrome警告:

CONSOLE WARNING: SVG's SMIL animations ('animate', 'set', etc.) are deprecated 
and will be removed. Please use CSS animations or Web animations instead.
Run Code Online (Sandbox Code Playgroud)

修订版196823:添加SMIL弃用警告


首先,我需要实现三件事:

1)鼠标悬停效果(最简单)

它怎么样:

<rect x="-0.5" y="-0.5" width="1" height="1" fill="white">
    <!--it makes half-visible selecting effect -->
    <set attributeName="stroke-opacity" begin="mouseover" end="mouseout" to="0.5"/>
    <!-- explicitly reverse the …
Run Code Online (Sandbox Code Playgroud)

css animation svg smil css-animations

37
推荐指数
1
解决办法
3万
查看次数

使用CSS动画调整SVG圆半径的大小

我正在尝试使用CSS为SVG圆的半径属性设置动画.虽然(使用Firefox Inspect Element工具)我可以看到动画本身设置正确,但".innerCircle"的大小没有明显改变.

如果你能发现任何我明显错过的东西,或者以任何方式帮助我都会非常感激.我对此很陌生,所以如果我错了,请善待!

我已将我的文件粘贴在下面以供参考.

再次感谢.

styling.css:

@keyframes buttonTransition {
  from {
    r: 5%;
  }
  to {
    r: 25%;
  }
}

.innerCircle {
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-name: buttonTransition;
}
Run Code Online (Sandbox Code Playgroud)

index.html的:

<html>
  <head>
    <link href = "styling.css" rel = "stylesheet" type = "text/css"></link>
  </head>
  <body>
    <svg class = "button" expanded = "true" height = "100px" width = "100px">
      <circle cx = "50%" cy = "50%" r = "35%" stroke = "#000000" stroke-width = "10%" fill = "none"/>
      <circle class = …
Run Code Online (Sandbox Code Playgroud)

html css svg css-animations

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

css ×2

css-animations ×2

svg ×2

animation ×1

html ×1

smil ×1