gwt jsni document.documentElement.style.height
gwt jsni document.documentElement.style.height
我尝试从这个链接调用代码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
的值吗?
尝试将其称为$doc
而不是document
参考编号:http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html
相关文章:
- 分析高度属性时出现意外值{{specs.height}}.index.html
- $(document).height()在刷新时随机化值(Safari 5.1.10)
- 在刚刚调用的append函数之后,jquery.height()不会返回实际值
- Phonegap css height%不适用于android 4.2-4.3
- $(document).height和$(window).heaght都返回相同的值-使用的是正确的doctype
- $(window).height() inside iframe?
- document.getElementById.style.backgroundImage not working
- 为什么我可以'不要使用xx[this.index].style.display?它's说“;无法读取属性
- HEAD中LINK和STYLE元素的求值顺序
- 如何让firefox使用style['attribute name']=设置样式属性
- 更改SVG'style'元素
- "无法获取属性'的值;style'"当试图在IE中更改样式时
- Javascript element.style.height 不起作用
- gwt jsni document.documentElement.style.height
- object.style.height;不起作用
- 两者的区别是什么?高度vs image .style. Height
- Elem.style.height在while循环中未被触发
- 无法在IE8上使用jS成功重置iframe.style.height
- 无法在 JS 中访问元素的 style.height
- 图像标记style.height未覆盖css类高度