Extjs getEl() 功能
位置设置:
getX()
getY()
getXY() 取得相对于页面的x,y坐标,用法:ele.getXY()[0]/[1]
getOffsetsTo(el)
setX(x,animate)
setY(y,animate) 同上
setLeft(left) 设style.left
setTop(top) 设style.top
setRight(right) 设style.right
setBottom(bottom) 设style.bottom
setXY(pos,animate) 设相对于页面的x,y,相当于setX,setY。用法:setXY([x,y],true)
setLocation(x,y,animate) 相当于setXY。
getRegion()
getHeight(true|false)
getBorderWidth(anthor)
getPadding(anthor)
getComputedHeight()
getComputedWidth()
getSize()
getStyleSize()
getViewSize()
getValue()
setWidth(width,animate)
setHeight(height,animate)
setSize(width,height,animate)
setBounds(x,y,width,height,animate)
setRegion(region,animate)
getScroll()
setOpacity(opacity,animate)
getLeft(local)
getRight(local)
getTop(local) false相当于getY,true相当于style.top
getBottom(local)
position(pos,zIndex,x,y)
clearPositionsing(value)
getPositioning() 取值格式如上{……}
setPositioning(pc)
setLeftTop(left,top)
moveTo(x,y,animate) 相当于setXY
move(direction,distance,animate)
getAnchorXY(anchor,local,s) 取得对齐到某处的页面x,y坐标
getCenterXY() 取得对齐到视口中央的页面x,y坐标
getAlignToXY(el,p,o) 取得对齐到某元素某处的页面x,y坐标
alignTo(element,position,offsets,animate) 对齐到元素的某处,允许偏移、动画
anchorTo(el,alignment,offsets,animate,monitorScroll,callback) 对齐到元素
center(centerIn) 对齐到视口中央
getBox(contentBox,local) contentBox=false包括边框、内边距 local=false获取页面坐标
setBox(box,adjust,animate)
getFrameWidth(sides,onlycontentBox)
repaint()
关于样式、属性设置
addClass(String/Array className )
removeClass(String/Array className)
replaceClass(String oldClassName, String newClassName )
radioClass(String/Array className )
toggleClass(String className )
setStyle(name,value)
getStyle(name)
hasClass(className)
addClassOnClick(classname)
addClassOnFocus(classname)
addClassOnOver(classname)
hover(classsname,bool preventFlicker)
页点操作:
append(ele)
appendTo(ele)
replace(ele)
replaceWith(ele)
insertBefore(ele)
insertAfter(ele)
insertFirst(ele)
insertHtml(where,html,returnEl)
insertSibling(el,where,returnDom)
remove()
createChild(config,HTMLElement insertbefore,returndom)
first(selector,returndom)
last(selector,returndom)
next(selector,returndom)
prev(selector,returndom)
parent(selector,returndom)
child(selector,returndom)
up(selector,maxdepth)
down(selector,maxdepth)
query(selector)
contains(HTMLElement/string el)
show(animate)
hide(animate)
toggle(animate)
setVisible(boolean visible,animate)
update(html, loadScripts, callback)
特殊的
hover( Function overFn, Function outFn, [Object scope] ) :Ext.Element
mask(msg, msgCls)
unmask()
load( String/Function url, [String/Object params], [Functioncallback], [Boolean discardUrl] )
focus()
blur()
事件注册:
on(eventname,fun)
un(eventname,fun)
addListenser/removeListenser/removeAllListeners