[GIS] How to add a popup on hover for a graphic using the ArcGIS JavaScript API

arcgis-javascript-apiarcgis-serverjavascript

I created this JSFiddle for an example.

Currently, a user needs to click on the graphic point to see the attribute. How can I make it so the user only needs to hover over the graphic for the popup to open?

Thanks.

Best Answer

Add the graphics to a graphicsLayer, and listen for this layer's mouse-over event to detect when the hover starts. Listen for the mouse-out event to detect when the user's mouse has left the graphic (in which case you may want to close the infoWindow).

There's a sample here which demonstrates this, albeit in a slightly more complicated manner.

Related Question