How to use Behavior

xiaoxiao2021-04-05  251

BEHAVIOR is first new, then get_behaviors (). add, last initialize () is OK.

Epistem for Popupbehavior

_popupbehavior = new sys.ui.popupbehavior (); _popupControl.get_behaviors (); add (_popupbehavior); _popupbehavior.initialize ();

Where popupControl is an Atlas Control, you can use popupControl = new sys.ui.contorl ($ (YourDomelement));

In addition to set of questions about PopupBehavior: _popupBehavior.set_parentElement ($ (yourParentDOMElement)); this means is yourParentDOMElement popup to determine the location of the anchor point, note that there are only two objects position relationship _popupBehavior.set_positioningMode (Sys.UI.PositioningMode .Topleft); This is 8.

An example of HOVERBEHAVIOR

// add hover behavior to item group control var _hoverBehavior = new Sys.UI.HoverBehavior (); _hoverBehavior.set_hoverElement (_itemGroupDiv); _hoverBehavior.set_unhoverDelay (10); _itemGroupControl.get_behaviors () add (_hoverBehavior);. Var _unhoverHandle = Function .createdelegate (this, this._unhover); _hoverbehavior.unhover.add (_unhoverhandle); _hoverbehavior.initialize ();

This thing is more interesting, the key point is to set _unhoverhandle, this thing seems to be. The agent var _unhoverhandle = function.createdelegate (this, this._unhover); _ hoverbehavior.unhover.add (_unhoverhandle); That is to perform this._unhover () method

8 The question came out, how did this event pass parameters? It's more difficult to solve, 咔咔

转载请注明原文地址:https://www.9cbs.com/read-132053.html

New Post(0)