Usually one uses the GraphObject.mouseEnter and GraphObject.mouseLeave events. But since you mention “hover”, if you really want to wait before showing something, you can use the GraphObject.mouseHover event.
But using mouseLeave is problematic if what you are going to show is going to be in front of the object, because the new object will occlude the original object, causing the mouse to leave the original object and then entering the new object.
Instead you will probably want to implement a mouseLeave event handler on the new object, rather than on the original object.
Thanks for your reply, Walter!
But my question is how to toggle visibility of overlay panel?
how to control visibility of overlay panel when mouse over a picture which is neighbor of the overlay panel?
Plz tell me with lines of code.
Yes, It used adornment. But I’m gonna try in a different way. I already made picture and overlay panel.
They are siblings inside parent panel. How can I change visibility of overlay panel when mouse over picture?
Thanks for your suggestion. It helped me a lot!
As you said before, I’d like to implement a mouseLeave event handler on the overlay panel which is in front of the picture.
And I already implemented mouseEnter in the picture like this:
{
mouseEnter: function(e, obj) {
var panel = obj.panel.findObject(“hover-screenshot-panel”);
panel.visible = true;
},
}
Now where and how should I implement mouseLeave in which overlay panel should be hidden?