【发布时间】: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