SVGAngle
interface is used to represent a value that can be an
<angle>
or
<number>
value. An
SVGAngle
reflected through the
animVal
attribute is always read only.
An
SVGAngle
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
An
SVGAngle
object can be associated with a particular element. The associated element is used to determine which element's content attribute to update if the object reflects an attribute. Unless otherwise described, an
SVGAngle
object is not associated with any element.
每个
SVGAngle
object operates in one of two modes:
baseVal
member of an
SVGAnimatedAngle
),
SVGAngle
objects created with
SVGSVGElement.createSVGAngle()
.
SVG_ANGLETYPE_UNKNOWN
Some unknown type of value.
SVG_ANGLETYPE_UNSPECIFIED
<number>
interpreted as a value in degrees.
SVG_ANGLETYPE_DEG
<angle>
采用
deg
unit.
SVG_ANGLETYPE_RAD
<angle>
采用
rad
unit.
SVG_ANGLETYPE_GRAD
<angle>
采用
grad
unit.
unitType
SVG_ANGLETYPE_*
constants defined on this interface.
value
The value as a floating point value, in user units. Setting this attribute will cause
valueInSpecifiedUnits
and
valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting:
A
DOMException
with code
NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
valueInSpecifiedUnits
The value as a floating point value, in the units expressed by
unitType
. Setting this attribute will cause
value
and
valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting:
A
DOMException
with code
NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
valueAsString
The value as a
DOMString
value, in the units expressed by
unitType
. Setting this attribute will cause
value
,
valueInSpecifiedUnits
,和
unitType
to be updated automatically to reflect this setting.
Exceptions on setting:
A
DOMException
with code
SYNTAX_ERR
is raised if the assigned string cannot be parsed as a valid
<angle>
.
A
DOMException
with code
NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
newValueSpecifiedUnits
Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
Exceptions:
A
DOMException
with code
NOT_SUPPORTED_ERR
被引发若
unitType
is
SVG_ANGLETYPE_UNKNOWN
or not a valid unit type constant (one of the other
SVG_ANGLETYPE_*
constants defined on this interface).
DOMException
with code
NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.
convertToSpecifiedUnits
unitType
. Object attributes
unitType
,
valueInSpecifiedUnits
,和
valueAsString
might be modified as a result of this method.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SVGAngle
|
Chrome Yes | Edge ≤18 | Firefox Yes | IE ? | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
兼容性未知
SVGAngle
SVGAElement
SVGAltGlyphElement
SVGAnimateColorElement
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
SVGAnimatedPathData
SVGAnimatedPoints
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SVGAnimationElement
SVGCircleElement
SVGClipPathElement
SVGComponentTransferFunctionElement
SVGCursorElement
SVGDefsElement
SVGDescElement
SVGDocument
SVGElement
SVGEllipseElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGFilterPrimitiveStandardAttributes
SVGFitToViewBox
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
SVGGElement
SVGGlyphElement
SVGGradientElement
SVGGraphicsElement
SVGHKernElement
SVGImageElement
SVGLength
SVGLengthList
SVGLineElement
SVGLinearGradientElement
SVGMPathElement
SVGMarkerElement
SVGMaskElement
SVGMatrix
SVGMetadataElement
SVGMissingGlyphElement
SVGNumber
SVGNumberList
SVGPathElement
SVGPathSeg
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegClosePath
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegLinetoAbs
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegList
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPatternElement
SVGPoint
SVGPointList
SVGPolygonElement
SVGPolylineElement
SVGPreserveAspectRatio
SVGRadialGradientElement
SVGRect
SVGRectElement
SVGSVGElement
SVGScriptElement
SVGSetElement
SVGStopElement
SVGStringList
SVGStylable
SVGStyleElement
SVGSwitchElement
SVGSymbolElement
SVGTRefElement
SVGTSpanElement
SVGTests
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
SVGTransform
SVGTransformList
SVGTransformable
SVGURIReference
SVGUnitTypes
SVGUseElement
SVGVKernElement
SVGViewElement
SVGZoomAndPan
SVGZoomEvent
TimeEvent