0

I try to call the code from this link https://stackoverflow.com/a/9100406/942113 with gwt jsni.

My method looks like

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

But when I call it, nothing happens.

My question: Isn't it possible to set the value of document.documentElement.style.height with gwt jsni?

Community
  • 1
  • 1
ZehnVon12
  • 4,026
  • 3
  • 19
  • 23

1 Answers1

5

Try referring to it as $doc instead of document

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

dragon
  • 1,747
  • 15
  • 18