You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by socke <so...@web.de> on 2006/01/12 20:17:17 UTC
ECMAScript animation doesnt work :-/
HI friends,
why does the following animation done with ecmascript doesnt work in the batik jsvgcanvas ;(
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg>
<script type="text/ecmascript"><![CDATA[
var counter = 0;
function clicked()
{
counter++;
var q2=document.getElementById("q2");
if(counter%2==0)
q2.setAttribute("fill", "red");
else
q2.setAttribute("fill", "black");
if(counter==10)
counter= 0;
setTimeout("clicked()",800);
}
]]>
</script>
<rect x="100" y="100" width="100" height="100" stroke="black" stroke-width="2px" fill="silver" onload=" clicked()"/>
<text x="100" y="220" font-family="Verdana" font-size="10" fill="black">
Klick auf das obere Quadrat!
</text>
<rect id="q2" x="100" y="250" width="100" height="100" stroke="black" stroke-width="2px" fill="silver" />
</svg>
Re: ECMAScript animation doesnt work :-/
Posted by Cameron McCormack <ca...@aka.mcc.id.au>.
Hi.
socke:
> why does the following animation done with ecmascript doesnt work in the batik jsvgcanvas ;(
This works for me in Squiggle. Is that what you are trying it in, or
your own program using a JSVGCanvas?
Cameron
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: ECMAScript animation doesnt work :-/
Posted by J B <mo...@gmail.com>.
I am pretty sure Batik does not support animation.
Birch
On 1/12/06, socke <so...@web.de> wrote:
>
> HI friends,
>
> why does the following animation done with ecmascript doesnt work in the
> batik jsvgcanvas ;(
>
>
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
> <svg>
> <script type="text/ecmascript"><![CDATA[
>
> var counter = 0;
> function clicked()
> {
> counter++;
>
> var q2=document.getElementById("q2");
> if(counter%2==0)
> q2.setAttribute("fill", "red");
> else
> q2.setAttribute("fill", "black");
>
> if(counter==10)
> counter= 0;
>
> setTimeout("clicked()",800);
> }
>
> ]]>
> </script>
>
> <rect x="100" y="100" width="100" height="100" stroke="black"
> stroke-width="2px" fill="silver" onload=" clicked()"/>
> <text x="100" y="220" font-family="Verdana" font-size="10" fill="black">
> Klick auf das obere Quadrat!
> </text>
>
> <rect id="q2" x="100" y="250" width="100" height="100" stroke="black"
> stroke-width="2px" fill="silver" />
> </svg>
>
>
>
>