首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

mpath

<mpath>元素的子<animateMotion>元素提供了引用外部<path>元素作为运动路径的定义的能力。

用法上下文

分类

动画元素

允许的内容

任意数量的以下元素,以任何顺序:描述性元素

属性

全局属性

  • Core attributes »
  • Xlink attributes »
  • externalResourcesRequired

具体属性

  • xlink:hrefDOM InterfaceThis element implements the SVGMPathElement interface.ExampleSVG<svg width="100%" height="100%" viewBox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- Draw the outline of the motion path in blue, along with three small circles at the start, middle and end. --> <path id="path1" d="M100,250 C 100,50 400,50 400,250" fill="none" stroke="blue" stroke-width="7.06" /> <circle cx="100" cy="250" r="17.64" fill="blue" /> <circle cx="250" cy="100" r="17.64" fill="blue" /> <circle cx="400" cy="250" r="17.64" fill="blue" /> <!-- Here is a triangle which will be moved about the motion path. It is defined with an upright orientation with the base of the triangle centered horizontally just above the origin. --> <path d="M-25,-12.5 L25,-12.5 L 0,-87.5 z" fill="yellow" stroke="red" stroke-width="7.06" > <!-- Define the motion path animation --> <animateMotion dur="6s" repeatCount="indefinite" rotate="auto" > <mpath xlink:href="#path1"/> </animateMotion> </path> </svg>Result​SpecificationsSpecificationStatusCommentSVG Animations Level 2The definition of '<mpath>' in that specification.Editor's DraftNo changeScalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<mpath>' in that specification.RecommendationInitial definitionBrowser compatibilityFeatureChromeFirefox (Gecko)Internet ExplorerOperaSafariBasic support(Yes)(Yes)No support(Yes)?FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBasic support?????See also

扫码关注腾讯云开发者

领取腾讯云代金券