新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论SVG, GML, X3D, VRML, VML, XAML, AVALON, Batik等基于XML的图形技术,以及有关GIS的应用。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - 高级XML应用『 SVG/GML/VRML/X3D/XAML 』 → 停止和播放动画的例子~ 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 13765 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 停止和播放动画的例子~ 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     tamefox 美女呀,离线,快来找我吧!魔羯座1980-1-1
      
      
      威望:1
      等级:大四(每天看1小时莱昂氏)
      文章:129
      积分:1236
      门派:XML.ORG.CN
      注册:2005/7/6

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给tamefox发送一个短消息 把tamefox加入好友 查看tamefox的个人资料 搜索tamefox在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看tamefox的博客楼主
    发贴心情 停止和播放动画的例子~

    <?xml version='1.0' standalone='no'?>
    <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20001102//EN'
      'http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd'>
    <svg width='100%' height='100%' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' onload='Init(evt)'>
       <title>Atomic Freeze</title>
       <desc>
          A demonstration of how to pause and play animations in SVG.
          Written by Doug Schepers [doug@schepers.cc], November 2004.
       </desc>
       <script><![CDATA[
          var SVGDocument = null;
          var SVGRoot = null;
          var svgns = 'http://www.w3.org/2000/svg';
          var xlinkns = 'http://www.w3.org/1999/xlink';
          var pauseButton = null;
          var playButton = null;
          function Init(evt)
          {
             SVGDocument = evt.target.ownerDocument;
             SVGRoot = SVGDocument.documentElement;
             pauseButton = SVGDocument.getElementById('pauseGroup');
             playButton = SVGDocument.getElementById('playGroup');
          };
          function Pause()
          {
             SVGRoot.pauseAnimations();
             pauseButton.setAttributeNS(null, 'display', 'none');
             playButton.setAttributeNS(null, 'display', 'inline');
          };
          function Play()
          {
             SVGRoot.unpauseAnimations();
             playButton.setAttributeNS(null, 'display', 'none');
             pauseButton.setAttributeNS(null, 'display', 'inline');
          };
       ]]></script>
       <defs>
          <g id='atomGroup1' stroke-width='5'>
             <line x1='300' y1='280' x2='300' y2='420' stroke-linecap='round'/>
             <circle cx='300' cy='280' r='20'/>
             <circle cx='300' cy='420' r='20'/>
             <animateTransform attributeType='XML' attributeName='transform' type='rotate' from='0,300,250' to='360,200,250' begin='0s' dur='5s' repeatCount='indefinite'/>
          </g>
       </defs>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='orange' fill='crimson'>
          <animateColor attributeName='fill' begin='0s' dur='15s' values='crimson;orange;crimson' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='0s' dur='15s' values='orange;crimson;orange' fill='freeze' repeatCount='indefinite'/>
       </use>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='cornflowerblue' fill='blue' transform='rotate(60,300,250)'>
          <animateColor attributeName='fill' begin='2s' dur='6s' values='cornflowerblue;blue;cornflowerblue' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='2s' dur='6s' values='blue;cornflowerblue;blue' fill='freeze' repeatCount='indefinite'/>
       </use>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='lawngreen' fill='green' transform='rotate(120,300,250)'>
          <animateColor attributeName='fill' begin='2s' dur='8s' values='green;lawngreen;green' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='2s' dur='10s' values='lawngreen;green;lawngreen' fill='freeze' repeatCount='indefinite'/>
       </use>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='gold' fill='goldenrod' transform='rotate(180,300,250)'>
          <animateColor attributeName='fill' begin='2s' dur='8s' values='goldenrod;gold;goldenrod' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='2s' dur='10s' values='gold;goldenrod;gold' fill='freeze' repeatCount='indefinite'/>
       </use>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='chocolate' fill='saddlebrown' transform='rotate(240,300,250)'>
          <animateColor attributeName='fill' begin='2s' dur='8s' values='saddlebrown;chocolate;saddlebrown' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='2s' dur='10s' values='chocolate;saddlebrown;chocolate' fill='freeze' repeatCount='indefinite'/>
       </use>
       <use x='0' y='0' xlink:href='#atomGroup1' stroke='lightcoral' fill='mediumvioletred' transform='rotate(300,300,250)'>
          <animateColor attributeName='fill' begin='2s' dur='8s' values='mediumvioletred;lightcoral;mediumvioletred' fill='freeze' repeatCount='indefinite'/>
          <animateColor attributeName='stroke' begin='2s' dur='10s' values='lightcoral;mediumvioletred;lightcoral' fill='freeze' repeatCount='indefinite'/>
       </use>
       <a id='playGroup' display='none' onclick='Play()'>
          <circle id='play' cx='50' cy='50' r='15' fill='green'/>
          <polygon points='46,44 57,50 46,56' fill='lime' stroke='lime' stroke-width='2' stroke-linejoin='round'/>
       </a>
       <a id='pauseGroup' display='inline' onclick='Pause()'>
          <circle id='pause' cx='50' cy='50' r='15' fill='red'/>
          <line x1='47' y1='45' x2='47' y2='55' stroke='pink' stroke-width='4' stroke-linecap='round'/>
          <line x1='54' y1='45' x2='54' y2='55' stroke='pink' stroke-width='4' stroke-linecap='round'/>
       </a>
    </svg>

    [此贴子已经被作者于2006-8-4 9:06:31编辑过]

       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    无为而无所不为
    有为而有所不为

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/7/21 16:42:00
     
     DJxiaoyang 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:2
      积分:63
      门派:XML.ORG.CN
      注册:2006/6/6

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给DJxiaoyang发送一个短消息 把DJxiaoyang加入好友 查看DJxiaoyang的个人资料 搜索DJxiaoyang在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看DJxiaoyang的博客2
    发贴心情 
    怎么看啊?
    我复制过来提示有错误!!!
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/8/3 18:09:00
     
     tamefox 美女呀,离线,快来找我吧!魔羯座1980-1-1
      
      
      威望:1
      等级:大四(每天看1小时莱昂氏)
      文章:129
      积分:1236
      门派:XML.ORG.CN
      注册:2005/7/6

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给tamefox发送一个短消息 把tamefox加入好友 查看tamefox的个人资料 搜索tamefox在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看tamefox的博客3
    发贴心情 
    将所有超链接中的“'”替换成“ ‘ ”(单撇号),再运行就可以了,发表的时候是单撇号的,不知道为何显示出来就变成了“'”

    ----------------------------------------------
    无为而无所不为
    有为而有所不为

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/8/4 9:09:00
     
     qb10 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:12
      积分:127
      门派:XML.ORG.CN
      注册:2006/11/27

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给qb10发送一个短消息 把qb10加入好友 查看qb10的个人资料 搜索qb10在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看qb10的博客4
    发贴心情 
    很不错!
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/4/20 12:13:00
     
     乖乖爱乖乖 美女呀,离线,快来找我吧!
      
      
      等级:大一新生
      文章:2
      积分:61
      门派:XML.ORG.CN
      注册:2008/5/6

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给乖乖爱乖乖发送一个短消息 把乖乖爱乖乖加入好友 查看乖乖爱乖乖的个人资料 搜索乖乖爱乖乖在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看乖乖爱乖乖的博客5
    发贴心情 
    如果不用脚本控制,直接用那些动画元素可以控制动画的播放和暂停吗
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/5/29 16:40:00
     
     zpjdgp888 帅哥哟,离线,有人找我吗?天秤座1983-10-3
      
      
      等级:大二(研究C++)
      文章:46
      积分:257
      门派:XML.ORG.CN
      注册:2008/3/18

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zpjdgp888发送一个短消息 把zpjdgp888加入好友 查看zpjdgp888的个人资料 搜索zpjdgp888在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zpjdgp888的博客6
    发贴心情 
    不错啊,谢谢分享
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/5/30 8:54:00
     
     GoogleAdSense天秤座1983-10-3
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/4/27 16:13:48

    本主题贴数6,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    93.750ms