简体   繁体   中英

Javascript, GWT

I have a hidden component that will be shown only if a mouse pointer is in some area (not necessary on top of the hidden component). Therefore, I am interested in catching all mouse move event from the browser. Is it posible with GWT, GXT, or with Javascript?

Thanks

Yes it is possible to detect mouse events.

For example if you are using jQuery:

    $(document).mousemove(function(event){

       var mouseX = event.clientX;
       var mouseY = event.clientY;

       //do something with the X and Y values

    });

Demo: http://jsfiddle.net/maniator/xqULX/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM