0
下面的代碼:鼠標滾輪事件不會觸發GWT FocusPanel,如果FocusPanel是GWT PopupPanel(僅適用於Chrome和Safari)
public class MyEntryPoint implements EntryPoint {
PopupPanel popupPanel = new PopupPanel(false,true);
FocusPanel focusPanel = new FocusPanel();
VerticalPanel popupContent = new VerticalPanel();
public void onModuleLoad() {
popupContent.add(new Label("Simple popup test"));
popupContent.add(new Label("_"));
focusPanel.add(popupContent);
popupPanel.setWidget(focusPanel);
popupPanel.center();
focusPanel.addMouseWheelHandler(new MouseWheelHandler(){
public void onMouseWheel(MouseWheelEvent event) {
System.out.println("deltaY = " + event.getDeltaY());
}
});
}
}
如果運行在Firefox中GWT應用程序,在移動鼠標文本「簡單彈出測試」並滾動鼠標滾輪,然後onMouseWheel將被調用。
如果此應用程序在Chrome或Safari中運行,請將鼠標放在文本「簡單彈出測試」上並滾動鼠標滾輪,然後onMouseWheel未調用。如果您將鼠標光標放在GWT標籤上並滾動鼠標滾輪,則會在onMouseWheel上調用該事件。
也許有人已經糾正了這個?非常感謝你。
是的,這有助於: [http://code.google.com/p/google-web-toolkit/issues/detail?id=7349](http://code.google.com/p/ google-web-toolkit/issues/detail?id = 7349) 非常感謝。 – Sprinter