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

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

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

Element.getScrollWidth介绍

[英]The width of the scroll view of an element.
[中]元素的滚动视图的宽度。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * The width of the scrollable area of the document.
  3. *
  4. * @return the width of the document's scrollable area
  5. */
  6. public final int getScrollWidth() {
  7. // TODO(dramaix): Use document.scrollingElement when its available. See getScrollLeft().
  8. return getViewportElement().getScrollWidth();
  9. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Get the maximum horizontal scroll position.
  3. *
  4. * @param scrollable the scrollable element
  5. * @return the maximum scroll position
  6. */
  7. public int getMaximumHorizontalScrollPosition(Element scrollable) {
  8. return isRtl(scrollable) ? 0 : scrollable.getScrollWidth() - scrollable.getClientWidth();
  9. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Get the minimum horizontal scroll position.
  3. *
  4. * @param scrollable the scrollable element
  5. * @return the minimum scroll position
  6. */
  7. public int getMinimumHorizontalScrollPosition(Element scrollable) {
  8. return isRtl(scrollable) ? scrollable.getClientWidth() - scrollable.getScrollWidth() : 0;
  9. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public void setScrollLeft(Element elem, int left) {
  3. if (!isGecko19() && isRTL(elem)) {
  4. left += elem.getScrollWidth() - elem.getClientWidth();
  5. }
  6. super.setScrollLeft(elem, left);
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public void setScrollLeft(Element elem, int left) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. left += elem.getScrollWidth() - elem.getClientWidth();
  5. }
  6. super.setScrollLeft(elem, left);
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public int getScrollLeft(Element elem) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. return super.getScrollLeft(elem)
  5. - (elem.getScrollWidth() - elem.getClientWidth());
  6. }
  7. return super.getScrollLeft(elem);
  8. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public int getScrollLeft(Element elem) {
  3. if (!isGecko19() && isRTL(elem)) {
  4. return super.getScrollLeft(elem)
  5. - (elem.getScrollWidth() - elem.getClientWidth());
  6. }
  7. return super.getScrollLeft(elem);
  8. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. void scrollToEnd() {
  2. Element elem = getElement();
  3. targetScrollLeft = elem.getScrollWidth() - elem.getClientWidth();
  4. if (LocaleInfo.getCurrentLocale().isRTL()) {
  5. targetScrollLeft *= -1;
  6. }
  7. if (isAnimationEnabled()) {
  8. // Animate the scrolling.
  9. startScrollLeft = elem.getScrollLeft();
  10. run(250, elem);
  11. } else {
  12. // Scroll instantly.
  13. onComplete();
  14. }
  15. }
  16. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. collapsible.setScrollLeft(collapsible.getScrollWidth() + 100);

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * The width of the scrollable area of the document.
  3. *
  4. * @return the width of the document's scrollable area
  5. */
  6. public final int getScrollWidth() {
  7. return getViewportElement().getScrollWidth();
  8. }

代码示例来源:origin: oVirt/ovirt-engine

  1. /**
  2. * Uses scrollWidth to detect horizontal overflow.
  3. */
  4. public static boolean detectHorizontalOverflow(Element element) {
  5. int scrollWidth = element.getScrollWidth();
  6. int clientWidth = element.getClientWidth();
  7. return scrollWidth > clientWidth;
  8. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Get the minimum horizontal scroll position.
  3. *
  4. * @param scrollable the scrollable element
  5. * @return the minimum scroll position
  6. */
  7. public int getMinimumHorizontalScrollPosition(Element scrollable) {
  8. return isRtl(scrollable) ? scrollable.getClientWidth() - scrollable.getScrollWidth() : 0;
  9. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Get the maximum horizontal scroll position.
  3. *
  4. * @param scrollable the scrollable element
  5. * @return the maximum scroll position
  6. */
  7. public int getMaximumHorizontalScrollPosition(Element scrollable) {
  8. return isRtl(scrollable) ? 0 : scrollable.getScrollWidth() - scrollable.getClientWidth();
  9. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Get the minimum horizontal scroll position.
  3. *
  4. * @param scrollable the scrollable element
  5. * @return the minimum scroll position
  6. */
  7. public int getMinimumHorizontalScrollPosition(Element scrollable) {
  8. return isRtl(scrollable) ? scrollable.getClientWidth() - scrollable.getScrollWidth() : 0;
  9. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public void setScrollLeft(Element elem, int left) {
  3. if (!isGecko19() && isRTL(elem)) {
  4. left += elem.getScrollWidth() - elem.getClientWidth();
  5. }
  6. super.setScrollLeft(elem, left);
  7. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. public void setScrollLeft(Element elem, int left) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. left += elem.getScrollWidth() - elem.getClientWidth();
  5. }
  6. super.setScrollLeft(elem, left);
  7. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public void setScrollLeft(Element elem, int left) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. left += elem.getScrollWidth() - elem.getClientWidth();
  5. }
  6. super.setScrollLeft(elem, left);
  7. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. public int getScrollLeft(Element elem) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. return super.getScrollLeft(elem)
  5. - (elem.getScrollWidth() - elem.getClientWidth());
  6. }
  7. return super.getScrollLeft(elem);
  8. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public int getScrollLeft(Element elem) {
  3. if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
  4. return super.getScrollLeft(elem)
  5. - (elem.getScrollWidth() - elem.getClientWidth());
  6. }
  7. return super.getScrollLeft(elem);
  8. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public int getScrollLeft(Element elem) {
  3. if (!isGecko19() && isRTL(elem)) {
  4. return super.getScrollLeft(elem)
  5. - (elem.getScrollWidth() - elem.getClientWidth());
  6. }
  7. return super.getScrollLeft(elem);
  8. }

相关文章

Element类方法