Ext.Element API比较多,大伙用的时候也难以在短时间把住它的脉络,主要功能。这个给个总结,而不是一个API说明。说到API说明,网上早有大侠做得蛮不错的了。
位置设置:
getX() 取得相对于页面的x坐标
getY() 取得相对于页面的y坐标
getXY() 取得相对于页面的x,y坐标,用法:ele.getXY()[0]/[1]
getOffsetsTo(el) 取得相对元素el的坐标,返回值[x,y]
setX(x,animate) 设相对于页面的x坐标,animate为true则开启默认动画效果
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() return {top=t,left=l,width=w,height=r}
getHeight(true|false) true不包括边框、内边距,false包括
getBorderWidth(anthor)
getPadding(anthor)
getComputedHeight() 包括边框、内边距
getComputedWidth()
getSize() 相当于getWidth、getHeight {width:w,height:h}
getStyleSize() 取style.width、style.height,且不包括边框{width:w,height:h}
getViewSize() 取视口大小{width:w,height:h}
getValue() 如果有value属必就取它
setWidth(width,animate) 设style.width
setHeight(height,animate) 设style.height
setSize(width,height,animate)
setBounds(x,y,width,height,animate) 相当于setSize、setXY
setRegion(region,animate) 相当于setBounds
getScroll() 取得当前视口在文档中水平、垂直方向上的偏移,返回{left:l,top:t}
setOpacity(opacity,animate)
getLeft(local) false相当于getX,true相当于style.left
getRight(local) false相当于getX+getWidth,true相当于getLeft(true)+getWidth()
getTop(local) false相当于getY,true相当于style.top
getBottom(local)
position(pos,zIndex,x,y) string:pos,取static,relative,absolute,fixed
zIndex设z序,x,y用来调用setXY的
clearPositionsing(value) 作用非得看代码
clearPositioning : function(value){
value = value ||'';
this.setStyle({
"left": value,
"right": value,
"top": value,
"bottom": value,
"z-index": "",
"position" : "static"
});
return this;
}
getPositioning() 取值格式如上{……}
setPositioning(pc) 用法同applyStyles
setLeftTop(left,top) 就是设style.left,style.top
moveTo(x,y,animate) 相当于setXY
move(direction,distance,animate) 很有用,direction移动方向,取t,l,r,b。
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) box包括边框、内边距
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], [Function callback], [Boolean discardUrl] )
focus()
blur()
事件注册:
on(eventname,fun)
un(eventname,fun)
addListenser/removeListenser/removeAllListeners
分享到:
相关推荐
ExtJS tooltip功能组件实例
extjs打印功能 可以实现选中列打印。
ExtJS 表格的功能实现,包括单元格编辑,数据的获取。
ExtJs 的日期控件不带清空功能,项目有可能需要一个带清空功能的日期控件。
EXTJS应用EXTJS应用EXTJS应用EXTJS应用EXTJS应用EXTJS应用
extjs资料extjs资料extjs资料extjs资料extjs资料
Extjs框架实现类似QQ的聊在功能.好友上线,下线提醒.留言,发表情,来消息提醒等功能
Extjs4登录功能+验证码+struts2
ExtJS分页功能
由于开发WEB需要一个WEB计算器插件,在网上找EXTJS4计算器插件没有一个,找extjs4.0计算器找到一个,但由于代码太多,在主界面上写太多代码,自我感觉以后看起来吃力,思路一下子不好摸到。因此写了这个插件,分享给...
第一章 起步1在这章里我们将介绍ExtJS的基本功能。如果你对web开发熟悉的话您会惊诧于ExtJS框架的优雅不同其他的JavaScript库ExtJS为您的开发夯实了基础只需几行代码你就可以制作出丰富的用户界面。本...
Extjs例子Extjs例子Extjs例子Extjs例子Extjs例子
ExtJs菜单导航 可以不用左边的树功能导航,而在一个工具条上放一系列的菜单功能项
ExtJs+Dwr带分页分组传参后台排序功能的grid 主要包含:这个主要用到ExtJS+DWR+Spring+Hibernate,主要包括浏览页(usernamerecord.jsp),脚步文件(usernamerecord.js),dwr分页代理脚本文件(dwrproxy.js),...
Hibernate+Spring+Struts2+ExtJS开发CRUD功能
xtJs已经升级到了5.0了,目前可能多数应用还在使用ExtJs 3.系列。 从开发大型的web后台或者企业管理系统来看,ExtJs3的缺陷还是比较明显的,从ExtJs4 开始引入了MVC架构,从而能够从容的组织系统的JS文件了。 从...
Struts2+Spring+Hibernate+ExtJS开发CRUD功能
ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门 ExtJS快速入门ExtJS快速入门 ExtJS快速入门 ExtJS...
EXTJS实例 EXTJS树,可以编辑的EXTJS,EXTJS3.0
使用extjs的,可以直接粘贴到代码中,注意store的名字,就可以了。代码中的时间差为5秒,注意哦。