本文整理了Java中com.google.gwt.dom.client.Element.getOffsetParent()
方法的一些代码示例,展示了Element.getOffsetParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getOffsetParent()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getOffsetParent
[英]Returns a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element.
[中]返回对位于包含元素的最近(在包含层次结构中最近)的对象的引用。
代码示例来源:origin: sk.seges.acris/acris-recorder-client-core
private int getSubPixelAbsoluteTop(com.google.gwt.dom.client.Element elem) {
int top = 0;
com.google.gwt.dom.client.Element curr = elem;
while (curr.getOffsetParent() != null) {
top -= curr.getScrollTop();
curr = curr.getParentElement();
}
while (elem != null) {
top += elem.getOffsetTop();
elem = elem.getOffsetParent();
}
return top;
};
代码示例来源:origin: sk.seges.acris/acris-recorder-client-core
private int getSubPixelAbsoluteLeft(com.google.gwt.dom.client.Element elem) {
int left = 0;
com.google.gwt.dom.client.Element curr = elem;
while (curr.getOffsetParent() != null) {
left -= curr.getScrollLeft();
curr = curr.getParentElement();
}
while (elem != null) {
left += elem.getOffsetLeft();
elem = elem.getOffsetParent();
}
return left;
};
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Returns a GQuery collection with the positioned parent of the first matched element. This is
* the first parent of the element that has position (as in relative or absolute). This method
* only works with visible elements.
*/
public GQuery offsetParent() {
if (isEmpty()) {
return $();
}
Element offParent = JsUtils.or(get(0).getOffsetParent(), body);
while (offParent != null && !"body".equalsIgnoreCase(offParent.getTagName())
&& !"html".equalsIgnoreCase(offParent.getTagName())
&& "static".equals(getStyleImpl().curCSS(offParent, "position", true))) {
offParent = offParent.getOffsetParent();
}
return new GQuery(offParent);
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
private int[] offSet(com.google.gwt.dom.client.Element el) {
int left = -el.getOffsetLeft();
int top = -el.getOffsetTop();
com.google.gwt.dom.client.Element domElem = el;
while (true) {
domElem = domElem.getOffsetParent();
if (domElem == null)
break;
left -= domElem.getOffsetLeft();
top -= domElem.getOffsetTop();
}
if (el != this.wrapper.getElement()) {
left *= this.scale;
top *= this.scale;
}
return new int[] {left, top};
}
代码示例来源:origin: dankurka/mgwt
private int[] offSet(com.google.gwt.dom.client.Element el) {
int left = -el.getOffsetLeft();
int top = -el.getOffsetTop();
com.google.gwt.dom.client.Element domElem = el;
while (true) {
domElem = domElem.getOffsetParent();
if (domElem == null)
break;
left -= domElem.getOffsetLeft();
top -= domElem.getOffsetTop();
}
if (el != this.wrapper.getElement()) {
left *= this.scale;
top *= this.scale;
}
return new int[] {left, top};
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
Element offsetParent = get(0).getOffsetParent();
代码示例来源:origin: com.allen-sauer.gwt.dnd/gwt-dnd
Element p;
while (elem != null && (p = elem.getOffsetParent()) != null) {
if (!"visible".equals(DOMUtil.getEffectiveStyle(elem, "overflow"))) {
int left = elem.getAbsoluteLeft();
代码示例来源:origin: com.extjs/gxt
while (p != null && p != stope) {
ctop += p.getOffsetTop();
p = p.getOffsetParent().cast();
内容来源于网络,如有侵权,请联系作者删除!