0
我已经在我的Windows 7机器上实现一个SWT浏览器如下:SWT的浏览器不滚动
Browser browser;
try {
browser = new Browser(parent, SWT.NONE);
browser.setUrl(url);
} catch (final SWTError e) {
System.out.println(e);
}
我浏览到包含下面的源代码的页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<div style="overflow:scroll;position:fixed;width:300px;height:300px;">
<div style="height:1000px;">SWT won't scroll in this div</div>
</div>
</body>
</html>
它使用Internet Explorer 8框架来呈现精美的内容。现在,这里是奇怪的地方:使用我的滚轮,滚动间歇发生。经过一两圈(有时更多;看起来是随机的),页面停止滚动一下。
如果我输出SWT的滚动事件,所有的滚动事件输出,即使在浏览器不回应他们:
browser.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(final MouseEvent e) {
System.out.println(e);
}
});
滚动显示的问题也会发生不同的Windows Vista计算机上,并只发生在style="position:fixed;overflow;scroll;height:300px;width:300px;"
的div中。但在Mac上,它不会。
看来罪魁祸首是Internet Explorer 8,或者SWT和浏览器之间的东西。有其他人遇到这个?有任何想法吗?