Select to view content in your preferred language

Does the popup window have a mouseout event?

4524
5
12-04-2013 05:27 AM
TyroneLigon
Deactivated User
I have source-destination pairs of markers on the map. When the user mouses over a marker, the popup dijit displays; the marker does not have a mouseout action defined. Embedded in the popup window is the marker's graphic (we use picture markers). When the user mouses over the embedded graphic, a line is displayed on the map connecting to the paired graphic; when the user mouses out of the embedded graphic, the line is removed from the map.

Because there is some functionality embedded in the popup, I don't close the popup window upon mousing out from the map marker. As a consequence, the only way to close the popup is to mouse over another marker or click the popup's close button. I was thinking maybe it would be cool to just mouse out of the popup to trigger the close action. Does anybody know if the popup window has a mouseout event and if so how do I capture it?
0 Kudos
5 Replies
JasonZou
Frequent Contributor
Assuming djtPopup holds the reference to the popup, then try below code.

on(djtPopup.domNode, "mouseout", function() {
    djtPopup.hide();
});
0 Kudos
TyroneLigon
Deactivated User
Sorry for the delay in a reply; your suggestion works a little too well. If I mouse over the popup window's header, the mouseout event is triggered. I have bold text in my infoWindow content; if I mouse over the text the mouseout event is triggered. If I move the mouse over the popup's pointer, then move the mouse off the pointer into the window, the mouseout event is triggered. It seems I have to attach the listener to a different object in the DOM, but I haven't figured out which one yet.
0 Kudos
JustinFultz
Regular Contributor

Did you ever get this resolved. I have the same behavior. If i use the mouse out event, I can't interact at all with the popup. Any time the pointer goes over the popup it dissapears.

Thanks for any guidance you can provide!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Justin,

  I use the domNode mouse out like Jason suggests in my Identify widget for WAB and it works flawlessly

0 Kudos
JustinFultz
Regular Contributor

I was unable to get this to behave as i wanted. My final solution was to create a polygon layer and place it around my boundary layer. I then created a mouse-over event for that layer that removes the popup. Dirty, but got me where i needed to be.

0 Kudos