SVG animate呼吸シンチレーション効果を実現

1363 ワード



 

     
       
    
    
    

 
  
        

        
$(function(){ <span> </span>var currentX=200; <span> </span>var currentY=200; <span> </span>var html = "<circle cx='"+currentX+"' cy='"+currentY+"' r='5' stroke='blue' stroke-width='0' fill='blue'> "+ "<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.4' fill='freeze'/>"+ "<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.4' to='1' fill='freeze'/>"+ "</circle>"; $("#svgBack").html(html); });