View Single Post

  #1 (permalink)  
Old 04-14-2004, 09:50 AM
chore_ashwin
Guest
 
Posts: n/a
Default how to show svg dig step by step

I want to print 3 circles step by step, ie display ist then pose then display next
I am using setTimeout() function as follows but it is not working, whole dig seems to be drawn at the same time
please help me out how to use setTimeout(), or anyother way to do the same



<svg onload="init(evt)" >
<script language="javascript">
<![CDATA[
var svgDocument=null;
var svgns ="http://www.w3.org/2000/svg";
var node;

function init(event){

svgDocument= event.target.ownerDocument;
for(var i=0;i<3;i++){
node = svgDocument.createElementNS(svgns, "circle");
node.setAttributeNS(null, "id",i);
node.setAttributeNS(null, "cx",i*50);
node.setAttributeNS(null, "cy",50);
node.setAttributeNS(null, "r", 15);
node.setAttributeNS(null,"fill", "yellow");
svgDocument.documentElement.appendChild(node);
setTimeout("timeout()",1000);
}
}

function timeout(){

}
window.timeout=timeout;
]]>
Reply With Quote