Я сделал Путь с SVG, и я делаю мяч, чтобы двигаться по нему.animateMotion Контроль со сценарием
Но все равно я могу контролировать движение мяча?
Мол, мяч начинает купирован, в то время как я нажмите стрелку вправо на клавиатуре, мяч движется по часовой стрелке, и, когда я нажмите стрелку влево, мяч движется против часовой стрелки ...
возможно ?
здесь код SVG:
<svg width="800" height="800" viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Draw the outline of the motion path in grey, along
with 2 small circles at key points -->
<path d="M66,89.32c18,143,154,82,97,118s-187,38-152,102s114,105,163,74
s89-111,89-127s18-128,13-155s-29-67-57-80s-47-14-62-17s-17-8-32,0s-40,23-47,30s-11,20-16,24s-14,29-14,29L66,89.32z" stroke="lightgrey" stroke-width="2" fill="none" id="theMotionPath"/>
<!-- Here is a red circle which will be moved along the motion path. -->
<circle cx="" cy="" r="5" fill="red">
<!-- Define the motion path animation -->
<animateMotion dur="6s" repeatCount="indefinite">
<mpath xlink:href="#theMotionPath"/>
</animateMotion>
</circle>
Я положил свой код здесь: http://jsfiddle.net/fPQv2/
Спасибо !!
Спасибо за этого человека! Но то, что мне действительно нужно сделать, это как ... шаг за шагом ... вроде .. я нажимаю (1), мяч движется как «1 кадр» и паузы .... И так продолжайте. ... – efdutra