【问题标题】:gwt jsni document.documentElement.style.heightgwt jsni document.documentElement.style.height
【发布时间】:2012-02-22 21:13:17
【问题描述】:

我尝试从此链接调用代码 https://stackoverflow.com/a/9100406/942113 与 gwt jsni。

我的方法看起来像

  public static native void hideAddressBar() /*-{
        if (document.documentElement.scrollHeight < $wnd.outerHeight * $wnd.devicePixelRatio) {
            document.documentElement.style.height = ($wnd.outerHeight * $wnd.devicePixelRatio) + 'px';
        }
        setTimeout($wnd.scrollTo(1, 1), 0);
  }-*/;

但是当我调用它时,什么也没有发生。

我的问题:不能用 gwt jsni 设置document.documentElement.style.height 的值吗?

【问题讨论】:

    标签: java javascript gwt jsni


    【解决方案1】:

    尝试将其称为$doc 而不是document

    参考:http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 2013-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多