`

getEle()

阅读更多

位置设置:

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

分享到:
评论

相关推荐

    解决jQuery uploadify在非IE核心浏览器下无法上传

    之前上传了一个通过Flash实现多文件上传,但是在IE正常运行,FireFox 不能正常上传。经过反复研究学习,之所以firefox和360浏览器无法正常运行,是因为FireFox、chrome、360浏览器等支持HTML5的浏览器不会再文件上传...

    document.getElementsByName和document.getElementById 在IE与FF中不同实现

    对于ID & Name 按最经典的解释的:“ID 就如同我们的身份证,Name就如同我们的名字”,也就是说,在一个html文档中ID是唯一的,但是Name是可以重复的,就象我们的人名可以重复但是身份证确实全中国唯一的(PS:据说...

    易语言操作网页教程输入文本

    易语言操作网页教程输入文本源码,操作网页教程输入文本,setWeb,go,input,getEle,sub_wait,sub_delay,sub_serchTag

    易语言操作网页教程点击

    易语言操作网页教程点击源码,操作网页教程点击,setWeb,go,input,click,getEle,sub_wait,sub_delay,sub_serchTag

    基于javascript实现简单计算器功能

    本文实例为大家介绍javascript实现简单计算器功能的详细代码,分享给大家供大家参考,具体内容如下 效果图: 实现代码: <html> <head> [removed] function calc(event)... var res = document.getEle

    JSP 前端数据本地排序实例代码

    在前端中我们经常需要数据的排序,首先写引入我写好的js $(function($) { $('#sclazzId').val($('#voId').val()); document.getElementsByName('nameup')[0].style.display = none;... document.getEle

    document.createElement()用法

    document.createElement()是在对象中创建一个对象,要与appendChild() 或 insertBefore()方法联合使用。其中,appendChild() 方法在节点的子节点列表末添加新的... 代码如下: [removed] var board = document.getEle

    同步异步动态引入js文件的几种方法总结

    动态加载js文件 有时候我们需要根据参数不同来引入不同的js文件,用html直接写标签满足不了我们的需求,总结几种方法,以及同步异步加载的各种需求...一.直接加载 <div id=divId></div> [removed] 二....document.getEle

    易语言操作网页教程取图片

    易语言操作网页教程取图片源码,操作网页教程取图片,setWeb,go,input,click,select,getPic,getEle,sub_wait,sub_delay,sub_serchTag,clip_OpenClipboard,clip_CloseClipboard,clip_GetClipboardData,clip_...

    js设计模式之结构型享元模式详解

    运用共享技术有效地支持大量的细粒度的对象,避免对象间拥有相同内容造成多余的开销。 享元模式主要是对其数据、方法共享分离,将数据和方法分成内部数据、内部方法和外部数据、外部方法。... document.getEle

    JavaScript oncopy事件用法实例解析

    作用:当用户拷贝添加了oncopy事件的元素时触发 ...提示:如果想要禁止复制某个元素的内容,可以在该事件的函数中添加return: false;,禁止浏览器的默认行为 例如: <... let text = document.getEle

    JS获取节点的兄弟,父级,子级元素的方法

    先说一下JS的获取方法,其要比JQUERY的方法麻烦很多,后面以JQUERY的方法作对比。 JS的方法会比JQUERY麻烦很多,主要则是因为FF浏览器,FF浏览器会把你的换行也当最DOM元素 代码如下:”test”...var b =document.getEle

    JavaScript中document.referrer的用法详解

    前言 在JavaScript中,document对象有很多属性,其中有3个与对网页的请求有关的属性,它们分别是URL、domain和referrer。 URL属性包含页面完整的URL,domain属性中只包含页面的域名,而...var back = document.getEle

    JS简单计算器实例

    本文实例讲述了JS简单计算器的实现方法。分享给大家供大家参考。具体实现方法如下: 代码如下: <...  <head>  ... //js类型转换 parseInt(value,10)的意思就是将value的... var id1 = parseInt(document.getEle

    js核心基础之闭包的应用实例分析

    本文实例讲述了js闭包的应用。分享给大家供大家参考,具体如下: 需求:有一个列表,当点击哪一行,则显示当前是第... ... 第一行 第二行 第三行 错误js代码示范: ...function addHander(nodes){ ...var nodes=document.getEle

    易语言操作网页教程操作手机版网页

    易语言操作网页教程操作手机版网页源码,操作网页教程操作手机版网页,setWeb,setUA,setCookie,go,input,click,select,getPic,getEle,sub_wait,sub_delay,sub_serchTag,ie_置cookie,ie_置代理,ie_静音,ie_置UA,clip_...

    在Z-Blog中运行代码[html][/html](纯JS版)

    昨天的《利用th,colgroup,col定义表格样式》中,细心点的朋友会发现加了一个“运行...如果需要Fix Bug或者技术支持,欢迎给我留言^_^ 具体代码如下: 代码如下:function RunCode() { var ele = document.getEle

    js改变embed标签src值的方法

    本文实例讲述了js改变embed标签src值的方法。分享给大家供大家参考。具体分析如下: ... ... 试了下,发现这样不行,视频该怎么放还是怎么放,永远是刚打开那个。 第二想法,给embed外面加个...var tabv = document.getEle

    webtreemap:基于网络的树状图

    网络树图 新的2017年10月16日:master现在是webtreemap v2,具有错误修复,更多功能和不同(更简单)API的完整重写。 如果您正在寻找旧的Webtreemap,请参阅分支。...const container = document.getEle

    React Props

    React Props state 和 props 主要的区别在于 props 是不可变的,而 state 可以根据与用户交互来改变。这就是为什么有些容器组件需要定义 state 来更新和修改数据。 而子组件只能通过 props 来传递... document.getEle

Global site tag (gtag.js) - Google Analytics