Thomas Meinike: fadein/out opacity in svg

Beitrag lesen

Hallo,

Danke erstmal, trifft's aber noch nicht ganz. Ein einfaches fade-in ist mir klar, ich möchte aber, daß die opacity immer ein-und ausfadet während der Mauszeiger über dem Objekt ist, sozusagen ein pulsieren.

Hier noch eine weitere (etwas schnellere) Version mit opacity-Fading 1.0 --> 0.0 --> 1.0 usw.:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<svg>

<g>
    <circle cx="100" cy="100" r="30" style="fill: #F00"/>
    <circle cx="170" cy="100" r="30" style="fill: #090"/>
    <circle cx="240" cy="100" r="30" style="fill: #00C"/>

<animate id="einsnull" attributeName="opacity" attributeType="CSS" from="1.0" to="0.0"
      begin="mouseover;nulleins.end" dur="1s" fill="freeze"/>
    <animate id="nulleins" attributeName="opacity" attributeType="CSS" from="0.0" to="1.0"
      begin="einsnull.end" dur="1s" fill="freeze"/>
    <set attributeName="opacity" attributeType="CSS" to="1.0"
      begin="mouseout" fill="freeze"/>
  </g>

</svg>

MfG, Thomas