I have a DIV representing a BLUE rectangle with text "HELLO" that, when user clicks on it changes its colour to RED and text "BYE", and when user moves mouse cursor out, restores its original colour and text. These styles are described in CSS, and text is controlled from GWT Events (see Java code below).
The issue is that, when I move the mouse very fast, the ONMOUSEOUT event is not fired in any browser. But works fine if I move it slowly.
Any ideas, please? THANKS
MyFile.html
<div id="boxDiv" class="myStyle"></div>
MyFile.java
final Element boxDiv = DOM.getElementById("boxDiv");
DOM.sinkEvents((com.google.gwt.user.client.Element)boxDiv,Event.ONCLICK | Event.ONMOUSEOUT);
DOM.setEventListener((com.google.gwt.user.client.Element)boxDiv,new EventListener(){
public void onBrowserEvent(Event e) {
Element targetDiv = DOM.eventGetTarget(e);
switch (DOM.eventGetType(e)) {
case Event.ONCLICK: onClickHandler(e, targetDiv); break;
case Event.ONMOUSEOUT: onMouseOutHandler(e, targetDiv); break;
}
}