我正在渲染一个包含按钮的 html 页面。 我已经将一个方法绑定(bind)到浏览器窗口,该方法在调用按钮时打开一个 gwt 弹出窗口。
我的问题是,当我滚动页面时,弹出窗口保持固定并且页面滚动。我希望弹出窗口与 html 页面一起滚动。
此外,当弹出窗口打开时,不应允许用户访问应用的其他部分。
谁能帮帮我
最佳答案
假设您正在使用 PopupPanel
类,它就像调用正确的构造函数一样简单:
PopupPanel(boolean autoHide, boolean modal)
autoHide - true if the popup should be automatically hidden when the user clicks outside of it or the history token changes.
modal - true if keyboard or mouse events that do not target the PopupPanel or its children should be ignored
因此,如果您设置了模态参数,则无法在弹出窗口外单击,并且根本不应该发生滚动事件(这有点正确,因为滚动具有固定位置的弹出窗口没有多大意义。 .. 哦,至少出于非广告目的)。
关于javascript - GWT - 如何防止用户在显示弹出窗口时访问应用程序的其他部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16234704/