0

このリンクhttps://stackoverflow.com/a/9100406/942113からgwtjsniを使用してコードを呼び出そうとしています 。

私の方法は次のようになります

  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);
  }-*/;

しかし、私がそれを呼ぶとき、何も起こりません。

私の質問:document.documentElement.style.heightgwt jsniでの値を設定することはできませんか?

4

1 に答える 1

5

$docの代わりにそれを参照してみてくださいdocument

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

于 2012-02-22T21:22:41.027 に答える