com.google.gwt.dom.client.Element.getOffsetLeft()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(268)

本文整理了Java中com.google.gwt.dom.client.Element.getOffsetLeft()方法的一些代码示例,展示了Element.getOffsetLeft()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getOffsetLeft()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getOffsetLeft

Element.getOffsetLeft介绍

[英]The number of pixels that the upper left corner of the current element is offset to the left within the offsetParent node.
[中]当前元素左上角在offsetParent节点内向左偏移的像素数。

代码示例

代码示例来源:origin: stephenh/tessell

  1. @Override
  2. public int getOffsetLeft() {
  3. return element.getOffsetLeft();
  4. }

代码示例来源:origin: de.esoco/gewt

  1. /***************************************
  2. * Returns the integer coordinate of the right side of a widget relative to
  3. * it's parent.
  4. *
  5. * @param rWidget The widget to calculate the right coordinate of
  6. *
  7. * @return The right coordinate of the widget
  8. */
  9. private int getRightOfWidget(Widget rWidget)
  10. {
  11. Element rElement = rWidget.getElement();
  12. return rElement.getOffsetLeft() + rElement.getOffsetWidth();
  13. }

代码示例来源:origin: com.googlecode.mgwt/mgwt

  1. private int[] offSet(com.google.gwt.dom.client.Element el) {
  2. int left = -el.getOffsetLeft();
  3. int top = -el.getOffsetTop();
  4. com.google.gwt.dom.client.Element domElem = el;
  5. while (true) {
  6. domElem = domElem.getOffsetParent();
  7. if (domElem == null)
  8. break;
  9. left -= domElem.getOffsetLeft();
  10. top -= domElem.getOffsetTop();
  11. }
  12. if (el != this.wrapper.getElement()) {
  13. left *= this.scale;
  14. top *= this.scale;
  15. }
  16. return new int[] {left, top};
  17. }

代码示例来源:origin: dankurka/mgwt

  1. private int[] offSet(com.google.gwt.dom.client.Element el) {
  2. int left = -el.getOffsetLeft();
  3. int top = -el.getOffsetTop();
  4. com.google.gwt.dom.client.Element domElem = el;
  5. while (true) {
  6. domElem = domElem.getOffsetParent();
  7. if (domElem == null)
  8. break;
  9. left -= domElem.getOffsetLeft();
  10. top -= domElem.getOffsetTop();
  11. }
  12. if (el != this.wrapper.getElement()) {
  13. left *= this.scale;
  14. top *= this.scale;
  15. }
  16. return new int[] {left, top};
  17. }

代码示例来源:origin: fr.putnami.pwt/pwt

  1. @Override
  2. public void execute() {
  3. Element itemElement = item.getElement();
  4. InputSwitch.this.slider.getElement().getStyle().setWidth(itemElement.getClientWidth(), Unit.PX);
  5. InputSwitch.this.slider.getElement().getStyle().setMarginLeft(itemElement.getOffsetLeft() - 5, Unit.PX);
  6. }
  7. });

代码示例来源:origin: Putnami/putnami-web-toolkit

  1. @Override
  2. public void execute() {
  3. Element itemElement = item.getElement();
  4. InputSwitch.this.slider.getElement().getStyle().setWidth(itemElement.getClientWidth(), Unit.PX);
  5. InputSwitch.this.slider.getElement().getStyle().setMarginLeft(itemElement.getOffsetLeft() - 5, Unit.PX);
  6. }
  7. });

代码示例来源:origin: sk.seges.acris/acris-recorder-client-core

  1. private int getSubPixelAbsoluteLeft(com.google.gwt.dom.client.Element elem) {
  2. int left = 0;
  3. com.google.gwt.dom.client.Element curr = elem;
  4. while (curr.getOffsetParent() != null) {
  5. left -= curr.getScrollLeft();
  6. curr = curr.getParentElement();
  7. }
  8. while (elem != null) {
  9. left += elem.getOffsetLeft();
  10. elem = elem.getOffsetParent();
  11. }
  12. return left;
  13. };

代码示例来源:origin: fr.putnami.pwt/pwt

  1. int targetHeight = relativeElement.getOffsetHeight();
  2. int targetTop = relativeElement.getOffsetTop();
  3. int targetLeft = relativeElement.getOffsetLeft();

代码示例来源:origin: Putnami/putnami-web-toolkit

  1. int targetHeight = relativeElement.getOffsetHeight();
  2. int targetTop = relativeElement.getOffsetTop();
  3. int targetLeft = relativeElement.getOffsetLeft();

代码示例来源:origin: com.extjs/gxt

  1. int cleft = cellEl.getOffsetLeft();
  2. int cright = cleft + cellEl.getOffsetWidth();
  3. int sleft = c.getScrollLeft();

相关文章

Element类方法