m-gis核心库 / DomUtil
类: DomUtil
定义于: utils/DomUtil.ts:3
构造函数
构造函数
new DomUtil():
DomUtil
返回
DomUtil
方法
addClass()
staticaddClass(el,name):void
定义于: utils/DomUtil.ts:93
参数
el
HTMLElement
name
string
Adds name to the element's class attribute.
返回
void
create()
staticcreate(tagName,className?,container?):HTMLElement
定义于: utils/DomUtil.ts:38
参数
tagName
string
className?
string
container?
HTMLElement
Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
返回
HTMLElement
createSvg()
staticcreateSvg(width,height,path,container):SVGElement
定义于: utils/DomUtil.ts:163
参数
width
string
height
string
path
string
container
HTMLElement
返回
SVGElement
empty()
staticempty(el):void
定义于: utils/DomUtil.ts:64
参数
el
HTMLElement
Removes all of el's children elements from el
返回
void
get()
staticget(id):HTMLElement|null
定义于: utils/DomUtil.ts:10
Function
get(id: String|HTMLElement): HTMLElement Returns an element given its DOM id, or returns the element itself if it was passed directly.
参数
id
string | HTMLElement
返回
HTMLElement | null
getClass()
staticgetClass(el):any
定义于: utils/DomUtil.ts:146
参数
el
any
Returns the element's class.
返回
any
getStyle()
staticgetStyle(el,style):string
定义于: utils/DomUtil.ts:21
Function
getStyle(el: HTMLElement, styleAttrib: String): String Returns the value for a certain style attribute on an element, including computed values or values set through CSS.
参数
el
any
style
any
返回
string
hasClass()
statichasClass(el,name):boolean
定义于: utils/DomUtil.ts:76
Function
hasClass(el: HTMLElement, name: String): Boolean Returns true if the element's class attribute contains name.
参数
el
HTMLElement
name
string
返回
boolean
remove()
staticremove(el):void
定义于: utils/DomUtil.ts:52
t
参数
el
HTMLElement
Removes el from its parent element
返回
void
removeClass()
staticremoveClass(el,name):void
定义于: utils/DomUtil.ts:112
参数
el
HTMLElement
name
string
Removes name from the element's class attribute.
返回
void
setClass()
staticsetClass(el,name):void
定义于: utils/DomUtil.ts:132
参数
el
any
name
string
Sets the element's class.
返回
void