Wednesday, March 21, 2012

How can I handle Popup control auto hiding?

I useSys.UI.PopupBehavior to show a popup:

// find popup

popup =new Sys.UI.Control($("tblMenu<%= ClientID %>"));var elt = popup.element;// initilize popup

popup.element.style.zIndex = 10000;

popup.initialize();

var b = popup.get_behaviors()// initilize behavior to the popup

behavior =

new Sys.UI.PopupBehavior();

behavior.set_positioningMode(Sys.UI.PositioningMode.Absolute);

b.add(behavior);

behavior.initialize();

// visibility handlingif (flag){behavior.show();}else{behavior.hide();}

It's working very good but I'd like that the popup'd disappear after mouse leave it.

How can I do it?

Use the onmouseout event to do behavior.hide()

No comments:

Post a Comment