Members
(static, constant) exports.TRANSFORM :String
Vendor-prefixed fransform style name (e.g. `'webkitTransform'` for WebKit).
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
TRANSFORM
|
String |
- Source:
(static, constant) exports.TRANSFORMORIGIN :String
Vendor-prefixed tfransform-origin name (e.g. `'webkitTransformOrigin'` for WebKit).
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
TRANSFORMORIGIN
|
String |
- Source:
(static, constant) exports.TRANSITION :String
Vendor-prefixed transition name (e.g. `'WebkitTransition'` for WebKit).
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
TRANSITION
|
String |
- Source:
(static, constant) exports.CSSFILTER :String
Vendor-prefixed filter name (e.g. `'WebkitFilter'` for WebKit).
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
FILTER
|
String |
- Source:
Static Methods
(static) exports.createEl(tagName) [source]
Create a html element.
Parameter | Type | Description |
---|---|---|
tagName
|
String |
Returns:
HTMLElement:(static) exports.createElOn(tagName, style, container) [source]
Create a html element on the specified container
Parameter | Type | Description |
---|---|---|
tagName
|
String | |
style
|
String | css styles |
container
|
HTMLElement |
Returns:
HTMLElement:(static) exports.removeDomNode(node) [source]
Removes a html element.
Parameter | Type | Description |
---|---|---|
node
|
HTMLElement |
(static) exports.addDomEvent(obj, typeArr, handler, context) [source]
Adds a event listener to the dom element.
Parameter | Type | Description |
---|---|---|
obj
|
HTMLElement | dom element to listen on |
typeArr
|
String | event types, seperated by space |
handler
|
function | listener function |
context
|
Object | function context |
(static) exports.removeDomEvent(obj, typeArr, handler) [source]
Removes event listener from a dom element
Parameter | Type | Description |
---|---|---|
obj
|
HTMLElement | dom element |
typeArr
|
String | event types, separated by space |
handler
|
function | listening function |
(static) exports.listensDomEvent(obj, typeArr, handler) [source]
Check if event type of the dom is listened by the handler
Parameter | Type | Description |
---|---|---|
obj
|
HTMLElement | dom element to check |
typeArr
|
String | event |
handler
|
function | the listening function |
Returns:
Number: - the handler's index in the listener chain, returns -1 if not.(static) exports.preventDefault(event) [source]
Prevent default behavior of the browser.
preventDefault Cancels the event if it is cancelable, without stopping further propagation of the event.
preventDefault Cancels the event if it is cancelable, without stopping further propagation of the event.
Parameter | Type | Description |
---|---|---|
event
|
Event | browser event |
(static) exports.stopPropagation(e) [source]
Stop browser event propagation
Parameter | Type | Description |
---|---|---|
e
|
Event | browser event. |
(static) exports.offsetDom(dom, offsetopt) [source]
Get the dom element's current position or offset its position by offset
Parameter | Type | Default | Description |
---|---|---|---|
dom
|
HTMLElement | HTMLElement | |
offset
opt
|
Point | null | position to set. |
Returns:
Point: - dom element's current position if offset is null.(static) exports.getPagePosition(obj) [source]
获取dom对象在页面上的屏幕坐标
Parameter | Type | Description |
---|---|---|
obj
|
HTMLElement | Dom对象 |
Returns:
Object: 屏幕坐标(static) exports.getEventContainerPoint(ev) [source]
获取鼠标在容器上相对容器左上角的坐标值
Parameter | Type | Description |
---|---|---|
ev
|
Event | 触发的事件 |
Returns:
Point: left:鼠标在页面上的横向位置, top:鼠标在页面上的纵向位置(static) exports.setStyle(dom, strCss) [source]
为dom设置样式
Parameter | Type | Description |
---|---|---|
dom
|
HTMLElement | dom节点 |
strCss
|
String | 样式字符串 |
(static) exports.removeStyle(dom) [source]
清空dom样式
Parameter | Type | Description |
---|---|---|
dom
|
HTMLElement | dom节点 |
(static) exports.addStyle(dom, attr, value) [source]
为dom添加样式
Parameter | Type | Description |
---|---|---|
dom
|
HTMLElement | dom节点 |
attr
|
String | 样式标签 |
value
|
String | 样式值 |
(static) exports.hasClass(el, name) [source]
判断元素是否包含class
Parameter | Type | Description |
---|---|---|
el
|
HTMLElement | html元素 |
name
|
String | class名称 |
(static) exports.addClass(el, name) [source]
为dom添加class
Parameter | Type | Description |
---|---|---|
el
|
HTMLElement | html元素 |
name
|
String | class名称 |
(static) exports.removeClass(el, name) [source]
移除dom class
Parameter | Type | Description |
---|---|---|
el
|
HTMLElement | html元素 |
name
|
String | class名称 |
(static) exports.setClass(el, name) [source]
设置dom class
Parameter | Type | Description |
---|---|---|
el
|
HTMLElement | html元素 |
name
|
String | class名称 |
(static) exports.getClass(name) [source]
获取dom class
Parameter | Type | Description |
---|---|---|
name
|
String | class名称 |
(static) exports.copyCanvas(src) [source]
Copy the source canvas
Parameter | Type | Description |
---|---|---|
src
|
Element | Canvas | source canvas |
Returns:
Element|Canvas: target canvas(static) exports.setTransform(el, offset) [source]
Resets the 3D CSS transform of `el` so it is translated by `offset` pixels
Parameter | Type | Description |
---|---|---|
el
|
HTMLElement | |
offset
|
Point |