[英]gwt jsni document.documentElement.style.height
我嘗試使用gwt jsni從此鏈接https://stackoverflow.com/a/9100406/942113調用代碼。
我的方法看起來像
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
的值?
嘗試將其稱為$doc
而不是document
參考: http : //code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.