爱程序网

svg element | SVGSVGElement object中文文档(事件、方法、属性)

来源: 阅读:

组成:

该 SVGElement 对象有这些类型的成员

事件

该 SVGElement 对象包含以下事件.

EventDescription
click

当用户在当前对象上单击鼠标左键时触发。

Note  Starting with IE11, this event fires a MSPointerEvent object instead of MouseEvent. You can use the MouseEvent.pointerType property to determine the type of contact that the click originated from (touch, mouse, or pen).

dblclick

当用户在当前对象上双击鼠标左键时触发。

Note  Starting with IE11, this event fires a MSPointerEvent object instead of a MouseEvent. You can use the MouseEvent.pointerType property to determine the type of contact that the click originated from (touch, mouse, or pen).

focusin

当前对象设置为焦点前触发。

focusout

焦点转移时立即触发。

load

加载当前对象时触发。

mousedown

当鼠标在当前对象上处于“压下”状态时触发。

mousemove

当用户在当前对象上移动鼠标时触发。

mouseout

当用户移动鼠标超过当前对象边界时触发。

mouseover

当用户将鼠标移动到当前对象范围时触发。

mouseup

当用户在当前对象上“释放”鼠标时触发(即鼠标按键弹起时)。

onabort

图像完成载入之前停止图像的装载时触发。

onerror

当一个元素不正确加载脚本运行不正确时触发

onload

浏览器已经完全解析所有元素和它所有的后代节点时触发

onresize

文档视图的大小改变时触发

onscroll

当文档视图沿着X轴、Y轴或者沿着X、Y轴同时移动时触发。

onunload

当文档从windows或者frame中移除时触发。

onzoom

文档缩放级别currentScale 的属性发生变化时触发

 

方法

该 SVGElement 对象包含以下方法.

MethodDescription
animationsPaused

判断此SVG文档片段是否处于暂停状态。(true:暂停状态否则,false)

checkEnclosure

判断元素是否超出指定矩形范围。(true:未超出范围否则,false)

checkIntersection

判断元素是否与指定矩形相交。

createEvent

Creates an event object to be used in conjunction with the dispatchEvent method.

createSVGAngle

Creates a new SVGAngle object that does not have units, that is set to 0 degrees, and that is not attached to any document.

createSVGLength

Creates a new SVGLength object that has a length of 0 user units.

createSVGMatrix

Creates a new SVGMatrix object that is set to the identity matrix and that is not attached to any document.

createSVGNumber

Creates a new SVGNumber object that has a value of zero and that is not attached to any document.

createSVGPoint

Creates a new SVGPoint object that is initialized to the point (0,0) in the user coordinate system and that is not attached to any document.

createSVGRect

Creates a new SVGRect object that has all values set to 0 user units and that is not attached to any document.

createSVGTransform

Creates a new SVGTransform object that is set to the identity matrix and that is not attached to any document.

createSVGTransformFromMatrix

Creates a matrix transform object whose values are given by the specified matrix.

deselectAll

Cancels the selection of any selected objects, including any selections of text strings and text boxes.

forceRedraw

Redraws all regions of the viewport that require updating.

getBBox

Gets the bounding box, in current user space, of the geometry of all contained graphics elements.

getComputedStyle

Returns the current computed value of the combined CSS properties for an element.

getCTM

Gets the transformation matrix that transforms from the current user units to the viewport coordinate system for the nearestViewportElement object.

getCurrentTime

Gets the current time, in seconds, relative to the start time for the current SVG document fragment.

getElementById

Gets the element that matches the specified ID from the SVG document or document fragment.

getEnclosureList

Gets the list of graphics elements whose rendered content is entirely contained within the specified rectangle.

getIntersectionList

Gets the list of graphics elements whose rendered content intersects the specified rectangle.

getScreenCTM

Gets the transformation matrix from the current user units to the screen coordinate system.

getTransformToElement

Gets the transformation matrix that transforms from the user coordinate system on the current element to the user coordinate system on the specified target element.

hasExtension

Determines if the specified extension is supported.

pauseAnimations

Pauses all currently running animations that are defined within the SVG document fragment that corresponds to this svg element.

setCurrentTime

Sets the new current time for this SVG document fragment.

suspendRedraw

Suspends redrawing a device for a specified duration.

unpauseAnimations

Resumes currently running animations that are defined within the SVG document fragment.

unsuspendRedraw

取消指定的暂停重绘操作

unsuspendRedrawAll

Cancels all currently active suspensions of redrawing operations.

 

Properties

The SVGSVGElement object has these properties.

PropertyDescription

className

Gets the names of the classes that are assigned to this object.

clipPath

Sets or retrieves a reference to the SVG graphical object that will be used as the clipping path.

contentScriptType

Gets the default scripting language of the current document fragment.

contentStyleType

Gets the default style sheet language of the current document.

currentScale

Gets or sets the current scale factor, relative to the initial view (when this property is called from an outermost svg element.

currentTranslate

Gets or sets the current translation factor, relative to the initial view (when this property is called from an outermost svg element).

currentView

 

externalResourcesRequired

Gets a value that indicates whether referenced resources that are not in the current document are required to correctly render a given element.

farthestViewportElement

Gets a value that represents the farthest ancestor svg element.

focusable

Determines if an element can acquire keyboard focus (that is, receive keyboard events) and be a target for field-to-field navigation actions (such as when a user presses the Tab key).

height

定义一个元素的高

mask

Sets or retrieves a value that indicates a SVG mask.

nearestViewportElement

Gets a value that indicates which element established the current viewport.

ownerSVGElement

Gets the nearest ancestor svg element.

pixelUnitToMillimeterX

Gets or sets the size of a pixel unit along the x-axis of the viewport.

pixelUnitToMillimeterY

Gets or sets the size of a pixel unit along the y-axis of the viewport.

preserveAspectRatio

Gets an XML value that indicates whether to force uniform graphic scaling.

requiredExtensions

Gets a white space-delimited list of required language extensions.

requiredFeatures

Gets or sets a white space-delimited list of feature strings.

screenPixelToMillimeterX

Gets or sets the size of a screen pixel along the x-axis of the viewport.

screenPixelToMillimeterY

Gets or sets the size of a screen pixel along the y-axis of the viewport.

style

获取一个 style 对象。

systemLanguage

按照逗号分隔符的方式获取或设置一组语言名称。

useCurrentView

Gets or sets a value that indicates whether the current innermost SVG document fragment is the standard view (that is, based on attributes of the svg element such asviewBox) or a custom view (that is, a hyperlink into a particular view or other element.

viewBox

Gets a value that indicates how a graphic scales to fit a container element.

viewport

获取或设置当前viewport。

viewportElement

Gets the element that established the current viewport.

width

定义一个元素的宽度

x

获取或者设置X轴坐标值。

xmlbase

获取或设置元素基本属性

xmllang

获取或设置元素的语言属性。

xmlspace

Gets or sets a value that indicates whether white space is preserved in character data.

y

获取或者设置Y轴坐标值。

zoomAndPan

获取缩放平移属性元素。

 

标准信息

 

原文地址:http://msdn.microsoft.com/library/ff972122.aspx

 

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助