RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 1058321
Accepted
Alexandr_TT
Alexandr_TT
Asked:2020-12-13 23:31:58 +0000 UTC2020-12-13 23:31:58 +0000 UTC 2020-12-13 23:31:58 +0000 UTC

animateMotion动画开始前如何去掉左上角的物体?

  • 772

这个问题的灵感来自于答案。
红圈在动画开始前的左上角animateMotion。

下面是一个示例代码:

<div id="pathContainer4">
		<button id="btn1" onclick="forwardSVG()">forward</button />
		<button id="btn2" onclick="middleSVG()">Middle</button />
		<button id="btn3" onclick="backSVG()">Back</button />
</div>	
<svg  xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink" height="160" width="360" >
  <g fill="none" stroke="black" stroke-width="1">
    <path stroke-dasharray="3" id="motionpath2"
					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
  </g>
   <circle class="circle2" r=8 fill=red>
  			         
	 <animateMotion
	   id="forward"
	   dur="2s"
	   begin="indefinite"
	   repeatCount="1"
	   keyPoints="0;1"
	   keyTimes="0;1"
       calcMode="linear"	   >
		 <mpath href="#motionpath2" />
	 </animateMotion> 
		<animateMotion
		   id="middle"
		   dur="2s"
		   begin="indefinite"
		   repeatCount="1"
		   keyPoints="0.5;1"
		   keyTimes="0;1"
		   calcMode="linear"					>
		 <mpath href="#motionpath2" />
	    </animateMotion> 
		   <animateMotion
		   id="back"
		   dur="2s"
		   begin="indefinite"
		   repeatCount="1"
		   keyPoints="1;0"
		   keyTimes="0;1"
		   calcMode="linear"					>
		 <mpath href="#motionpath2" />
	    </animateMotion>
         </circle>
		</svg>
		
<script>
var animation1 = document.getElementById("forward")
function forwardSVG(){
     animation1.beginElement();
} 
var animation2 = document.getElementById("middle")
function middleSVG(){
     animation2.beginElement();
}  

var animation3 = document.getElementById("back")
function backSVG(){
     animation3.beginElement();
}
</script>

我试图通过向左移动来隐藏画布上的红色圆圈cx="-18"。但这并没有帮助,红色圆圈在路径上方的动画期间开始移动。

<div id="pathContainer4">
		<button id="btn1" onclick="forwardSVG()">forward</button >
		<button id="btn2" onclick="middleSVG()">Middle</button >
		<button id="btn3" onclick="backSVG()">Back</button >
</div>	
<svg  xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink" height="160" width="360" >
  <g fill="none" stroke="black" stroke-width="1">
    <path stroke-dasharray="3" id="motionpath2"
					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
  </g>
   <circle class="circle2" r="8" fill="red" cx="-18">
  			         
	 <animateMotion
	   id="forward"
	   dur="2s"
	   begin="indefinite"
	   repeatCount="1"
	   keyPoints="0;1"
	   keyTimes="0;1"
       calcMode="linear"	   >
		 <mpath href="#motionpath2" />
	 </animateMotion> 
		<animateMotion
		   id="middle"
		   dur="2s"
		   begin="indefinite"
		   repeatCount="1"
		   keyPoints="0.5;1"
		   keyTimes="0;1"
		   calcMode="linear"					>
		 <mpath href="#motionpath2" />
	    </animateMotion> 
		   <animateMotion
		   id="back"
		   dur="2s"
		   begin="indefinite"
		   repeatCount="1"
		   keyPoints="1;0"
		   keyTimes="0;1"
		   calcMode="linear"					>
		 <mpath href="#motionpath2" />
	    </animateMotion>
         </circle>
		</svg>
		
<script>
var animation1 = document.getElementById("forward")
function forwardSVG(){
     animation1.beginElement();
} 
var animation2 = document.getElementById("middle")
function middleSVG(){
     animation2.beginElement();
}  

var animation3 = document.getElementById("back")
function backSVG(){
     animation3.beginElement();
}
</script>

如何在动画开始之前使圆圈从SVG画布的左上角消失?

2019 年 12 月 16 日更新

感谢所有响应解决基本 SVG 问题的人。


但在我看来,每种解决方案都有一定的缺点:

  • 使用 SVG 命令的解决方案:对画布大小viewBox有translate限制。在其他尺寸下,运动路径或运动对象的修剪是可能的。
  • JS 解决方案代码繁重,会干扰 SVG 动画过程

在动画开始前通过 看向隐藏球的方向CSS。JS

代码的范围应该是最小的,并且对于 SVG 画布的任何值都是通用的。
新帖子中接受了已经回答的参与者的其他答案。也欢迎新成员的新回应。

javascript
  • 7 7 个回答
  • 10 Views

7 个回答

  • Voted
  1. meine
    2020-12-14T01:20:56Z2020-12-14T01:20:56Z

    脑袋上

    class SvgAnimation {
      constructor(node) {
        this.node = node;
    
        if (!this.node) return;
    
        this.controls = this.node.querySelector('.controls');
        this.svg = this.node.querySelector('svg');
    
        this.onControlClick = this.onControlClick.bind(this);
    
        this.controls.addEventListener('click', this.onControlClick, false);
      }
    
      onControlClick(e) {
        const button = e.target.closest('.btn');
    
        if (!button) return;
    
        const animationName = button.getAttribute('data-animation');
    
        if (!animationName)
          throw new Error('Missing required parameterm data-animation');
    
        const animationDur = +button.getAttribute('data-duration') || 2;
    
        if (isNaN(animationDur))
          throw new Error('data-duration property should be number value');
    
        this.startAnimation(animationName, animationDur);
      }
    
      startAnimation(animationName, animationDur) {
        const animation = document.querySelector(`[data-animation-name=${animationName}]`);
    
        if (!animation)
          throw new Error(`Cannot found animation with '${animationName}' name`);
    
        animation.setAttribute('dur', animationDur + 's');
    
        this.svg.classList.add('animate');
    
        animation.beginElement();
    
        setTimeout(() => {
          this.svg.classList.remove('animate')
        }, animationDur * 1000);
      }
    }
    
    const root = document.querySelector('.container');
    
    new SvgAnimation(root);
    svg circle {
      opacity: 0;
    }
    
    svg.animate circle {
      opacity: 1;
    }
    <div class="container">
      <div class="controls">
        <button class="btn" data-animation="forward" data-duration="2">forward</button>
        <button class="btn" data-animation="middle" data-duration="2">Middle</button>
        <button class="btn" data-animation="back" data-duration="2">Back</button>
      </div>
    
      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="160" width="360">
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpath2"
    					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
      </g>
       <circle class="circle2" r=8 fill=red>
      			         
    	 <animateMotion
    	   data-animation-name="forward"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"	   >
    		 <mpath href="#motionpath2" />
    	 </animateMotion> 
    		<animateMotion
    		   data-animation-name="middle"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion> 
    		   <animateMotion
    		   data-animation-name="back"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion>
             </circle>
    		</svg>
    </div>

    • 8
  2. br3t
    2020-12-15T06:41:56Z2020-12-15T06:41:56Z

    一个更加拐杖但可行的解决方案:将轨迹沿两个轴移动 10 个像素(这不适用于曲线,可以看出黑色新轨迹和橙色轨迹并不相同,但您可以通过以下方式计算公式点值应该是多少,我不擅长曲线),我们用CSS剪掉多余的部分。

    var animation1 = document.getElementById("forward");
    function forwardSVG(){
         animation1.beginElement();
    } 
    var animation2 = document.getElementById("middle");
    function middleSVG(){
         animation2.beginElement();
    }  
    
    var animation3 = document.getElementById("back");
    function backSVG(){
         animation3.beginElement();
    }
    .svg-wrapper {
        width:360px;
        height: 160px;
        overflow: hidden;
    }
    .svg-wrapper svg {
        margin: -10px 0 0 -10px;
    }
    <div id="pathContainer4">
    		<button id="btn1" onclick="forwardSVG()">forward</button>
    		<button id="btn2" onclick="middleSVG()">Middle</button>
    		<button id="btn3" onclick="backSVG()">Back</button>
    </div>
    <div class="svg-wrapper">
    <svg  xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink" height="170" width="370" >
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpathOriginal"
    					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" stroke="orange" />
        <path stroke-dasharray="3" id="motionpath2"
    					d="M 20 90 C 50 20, 85 20, 105 90 S 160 160, 190 90" />
      </g>
       <circle class="circle2" r=8 fill=red>
      			         
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"	   >
    		 <mpath href="#motionpath2" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion>
             </circle>
    		</svg>
    </div>

    • 6
  3. Alexandr_TT
    2020-12-15T07:49:05Z2020-12-15T07:49:05Z

    Прячем элемент до начала анимации <circle opacity="0" и показываем его после клика на любую из трех кнопок.

    circ.style.opacity = "1";  
    

     var circ =  document.getElementById("circle2");   
    var animation1 = document.getElementById("forward");
    function forwardSVG(){
          
    	 circ.style.opacity = "1";
    	 animation1.beginElement();
    	
    } 
    var animation2 = document.getElementById("middle")
    function middleSVG(){
         circ.style.opacity = "1";
    	 animation2.beginElement();
    }  
    
    var animation3 = document.getElementById("back")
    function backSVG(){
         circ.style.opacity = "1";
    	 animation3.beginElement();
    } 
    <div id="pathContainer4">
    		<button id="btn1" onclick="forwardSVG()">forward</button />
    		<button id="btn2" onclick="middleSVG()">Middle</button />
    		<button id="btn3" onclick="backSVG()">Back</button />
    </div>	
    <svg id="svg1"  xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink" height="160" width="360" >
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpath2"
    					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
      </g>
       <circle id="circle2" r="8" fill="red" opacity="0" >
      	 
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"  >
    		 <mpath href="#motionpath2" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#motionpath2" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#motionpath2" />
    	    </animateMotion>
             </circle>
    		</svg>
    		

    • 6
  4. Stranger in the Q
    2020-12-15T16:20:01Z2020-12-15T16:20:01Z

    В лоб так в лоб:

    <div>
        <button onclick="forward.beginElement()">forward</button>
        <button onclick="middle.beginElement()">Middle</button>
        <button onclick="back.beginElement()">Back</button>
    </div>	
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
        height="160" width="360" viewBox='0 10 360 160' >
        
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpath2"
              d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
      </g>
      <circle class="circle2" r=8 fill=red>
      			         
         <animateMotion calcMode="linear"	begin="indefinite" 
           id="forward" dur="2s" repeatCount="1"
           keyPoints="0;1"
           keyTimes="0;1">
             <mpath href="#motionpath2" />
         </animateMotion> 
    
          <animateMotion calcMode="linear"	begin="indefinite" 
             id="middle" dur="2s" repeatCount="1"
             keyPoints="0.5;1"
             keyTimes="0;1">
               <mpath href="#motionpath2" />
          </animateMotion> 
    
          <animateMotion calcMode="linear"	begin="indefinite"
             id="back" dur="2s" repeatCount="1"
             keyPoints="1;0"
             keyTimes="0;1">
               <mpath href="#motionpath2" />
           </animateMotion>
       </circle>
    </svg>

    Не нашли отличий? А теперь внимательно посмотрите на viewBox!

    • 5
  5. br3t
    2020-12-15T06:31:04Z2020-12-15T06:31:04Z

    好的,让我们试试:

    var animation1 = document.getElementById("forward");
    function forwardSVG(){
         animation1.beginElement();
         showHideCircle();
    } 
    var animation2 = document.getElementById("middle");
    function middleSVG(){
         animation2.beginElement();
         showHideCircle();
    }  
    
    var animation3 = document.getElementById("back");
    function backSVG(){
         animation3.beginElement();
         showHideCircle();
    }
    function showHideCircle() {
         var circle2 = document.querySelector('.circle2');
         circle2.style.fill = 'red';
         setTimeout(function() {
              circle2.style.fill = 'none';
         }, 1950);
    }
    <div id="pathContainer4">
    		<button id="btn1" onclick="forwardSVG()">forward</button>
    		<button id="btn2" onclick="middleSVG()">Middle</button>
    		<button id="btn3" onclick="backSVG()">Back</button>
    </div>	
    <svg  xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink" height="160" width="360" >
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpath2"
    					d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
      </g>
       <circle class="circle2" r=8 fill=none>
      			         
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"	   >
    		 <mpath href="#motionpath2" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear"					>
    		 <mpath href="#motionpath2" />
    	    </animateMotion>
             </circle>
    		</svg>
    		
    <script>
    
    </script>

    • 4
  6. Alexandr_TT
    2020-12-15T17:47:51Z2020-12-15T17:47:51Z

    translate(X Y)

    Это решение для частного случая, когда возможно перемещение с целью скрыть объект движения до начала анимации.

    Также этот пример помогает понять некоторые нюансы транcформации SVG

    Исходный пример

    <div>
        <button onclick="forward.beginElement()">forward</button>
        <button onclick="middle.beginElement()">Middle</button>
        <button onclick="back.beginElement()">Back</button>
    </div>	
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink"
    	       height="100vh" viewBox="0 0 600 600" > 
     <path  id="pathID" fill="black" stroke="black" stroke-width="1"
        d="M 0.00,250.00
           C 0.00,250.00 33.75,335.50 125.00,375.00
             216.75,415.00 250.00,500.00 250.00,500.00
             250.00,500.00 285.00,408.25 377.25,377.75
             469.50,346.75 500.00,250.00 500.00,250.00
             500.00,250.00 0.00,250.00 0.00,250.00 Z
           M 90.00,308.50" />   
    	   <circle id="circle2" cx="0" cy="0" r="15" fill="red"  >  
      	 
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"  >
    		 <mpath href="#pathID" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion>
             </circle>
    </svg>

    Как видите вверху достаточно места для перемещения основной фигуры.

    Двигаем фигуру вверх на 200px transform="translate(0 -200)"

    <div>
        <button onclick="forward.beginElement()">forward</button>
        <button onclick="middle.beginElement()">Middle</button>
        <button onclick="back.beginElement()">Back</button>
    </div>	
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink"
    	       height="100vh" viewBox="0 0 600 600" > 
    
    <path transform="translate(0 -200)" id="pathID" fill="black" stroke="black" stroke-width="1"
        d="M 0.00,250.00
           C 0.00,250.00 33.75,335.50 125.00,375.00
             216.75,415.00 250.00,500.00 250.00,500.00
             250.00,500.00 285.00,408.25 377.25,377.75
             469.50,346.75 500.00,250.00 500.00,250.00
             500.00,250.00 0.00,250.00 0.00,250.00 Z
           M 90.00,308.50" />   
    	   <circle id="circle2" cx="0" cy="0" r="15" fill="red" >  
      	 
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"  >
    		 <mpath href="#pathID" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion>
             </circle>
           
    </svg>

    Фигура поднялась на 200px, но это не затронуло объект движения - красный шарик. Он продолжает двигаться по старой траектории, как будто и не было сдвига траектории.

    Корректируем начальное положение красного шарика

    <circle id="circle2" cx="0" cy="-200" r="15" fill="red"  >
    

    <div>
        <button onclick="forward.beginElement()">forward</button>
        <button onclick="middle.beginElement()">Middle</button>
        <button onclick="back.beginElement()">Back</button>
    </div>	
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink"
    	       height="100vh" viewBox="0 0 600 600" > 
     <path transform="translate(0 -200)" id="pathID" fill="black" stroke="black" stroke-width="1"
        d="M 0.00,250.00
           C 0.00,250.00 33.75,335.50 125.00,375.00
             216.75,415.00 250.00,500.00 250.00,500.00
             250.00,500.00 285.00,408.25 377.25,377.75
             469.50,346.75 500.00,250.00 500.00,250.00
             500.00,250.00 0.00,250.00 0.00,250.00 Z
           M 90.00,308.50" />   
    	   <circle id="circle2" cx="0" cy="-200" r="15" fill="red"  >  
      	 
    	 <animateMotion
    	   id="forward"
    	   dur="2s"
    	   begin="indefinite"
    	   repeatCount="1"
    	   keyPoints="0;1"
    	   keyTimes="0;1"
           calcMode="linear"  >
    		 <mpath href="#pathID" />
    	 </animateMotion> 
    		<animateMotion
    		   id="middle"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="0.5;1"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion> 
    		   <animateMotion
    		   id="back"
    		   dur="2s"
    		   begin="indefinite"
    		   repeatCount="1"
    		   keyPoints="1;0"
    		   keyTimes="0;1"
    		   calcMode="linear" >
    		 <mpath href="#pathID" />
    	    </animateMotion>
             </circle>
    </svg>

    • 3
  7. Best Answer
    Stranger in the Q
    2020-12-17T20:44:13Z2020-12-17T20:44:13Z

    Вот еще один приемлемый вариант с opacity, но тут есть один глюк - при запуске новой анимации раньше завершения предыдущей.

    <div>
        <button onclick="forward.beginElement()">forward</button>
        <button onclick="middle.beginElement()">Middle</button>
        <button onclick="back.beginElement()">Back</button>
    </div>	
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
        height="160" width="360" viewBox='0 0 360 160' >
        
      <g fill="none" stroke="black" stroke-width="1">
        <path stroke-dasharray="3" id="motionpath2"
              d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80" />
      </g>
      <circle class="circle2" r=8 fill=red opacity=0>
             
         <animate id="showhide" 
                 attributeName="opacity"
                 dur="2s"
                 values="0;1;1;1;0"
                 keyTimes="0;0.05;0.5;0.95;1" 
                 begin="forward.begin;middle.begin;back.begin" />
                 
         <animateMotion calcMode="linear"	begin="indefinite" 
           id="forward" dur="2s" repeatCount="1"
           keyPoints="0;1"
           keyTimes="0;1">
             <mpath href="#motionpath2" />
         </animateMotion> 
    
          <animateMotion calcMode="linear"	begin="indefinite" 
             id="middle" dur="2s" repeatCount="1"
             keyPoints="0.5;1"
             keyTimes="0;1">
               <mpath href="#motionpath2" />
          </animateMotion> 
    
          <animateMotion calcMode="linear"	begin="indefinite"
             id="back" dur="2s" repeatCount="1"
             keyPoints="1;0"
             keyTimes="0;1">
               <mpath href="#motionpath2" />
           </animateMotion>
       </circle>
    </svg>

    • 1

相关问题

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    根据浏览器窗口的大小调整背景图案的大小

    • 2 个回答
  • Marko Smith

    理解for循环的执行逻辑

    • 1 个回答
  • Marko Smith

    复制动态数组时出错(C++)

    • 1 个回答
  • Marko Smith

    Or and If,elif,else 构造[重复]

    • 1 个回答
  • Marko Smith

    如何构建支持 x64 的 APK

    • 1 个回答
  • Marko Smith

    如何使按钮的输入宽度?

    • 2 个回答
  • Marko Smith

    如何显示对象变量的名称?

    • 3 个回答
  • Marko Smith

    如何循环一个函数?

    • 1 个回答
  • Marko Smith

    LOWORD 宏有什么作用?

    • 2 个回答
  • Marko Smith

    从字符串的开头删除直到并包括一个字符

    • 2 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5