http://blog.csdn.net/net_lover/archive/2002/01/25/6889.aspx

下面再看一个沿指定路径运动的例子:

xml 代码
  1. xml version="1.0" encoding="UTF-8" standalone="no"?>  
  2. "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">  
  3. <svg width="500" height="300" viewBox="0 0 500 300"  
  4. xmlns="http://www.w3.org/2000/svg">  
  5. <desc>沿路径运动的例子desc>  
  6. <defs>  
  7.   
  8. <linearGradient id="grad1" x1="0" y1="0" x2="0" y2="100%" gradientUnits="userSpace">  
  9. <stop offset="0%" style="stop-color: #88f;"/>  
  10. <stop offset="100%" style="stop-color: #008;"/>  
  11. linearGradient>  
  12. defs>  
  13. <rect x="1" y="1" width="498" height="298"  
  14. fill="none" stroke="blue" stroke-width="2" />  
  15.   
  16.   
  17. <path d="M100,250 C 100,50 400,50 400,250"  
  18. fill="none" stroke="blue" stroke-width="8" />  
  19.   
  20.   
  21. <circle r="25" style="fill:url(#grad1)">  
  22.   
  23. <animateMotion dur="6s" repeatCount="indefinite"  
  24. path="M100,250 C 100,50 400,50 400,250" rotate="auto" />  
  25. circle>  
  26. <text x="145" y="285" style="font-size:12pt">http://lucky.myrice.comtext>  
  27. svg>  
  28.   

 上面的例子应用了animateMotion动画元素,其属性设定和前面类似。

  • m2.rar (771 Bytes)
  • 描述:
  • 下载次数: 2
评论
发表评论

您还没有登录,请登录后发表评论

jacally
搜索本博客
我的相册
5225c084-f830-3bfb-89b4-e391c07b2221-thumb
flexlib6-1.jpg
共 27 张
最近加入圈子
存档
最新评论