Personal tools
Views

From ProtoScript

Jump to: navigation, search

Contents

YUI:Close Behavior

Removes the element or elements from the flow of the page... effectively closing the element or elements. Opposite of the Open Behavior.

Example

$proto('img#avatar', {
  Click: {
     onClick: {
        Close: {}
     }
  },
});

When the user clicks on the avatar (an image with ID='avatar'), changes it's display to 'none' (causing it to close).

Attributes

Name Description Default Valid Values Example
target Selected element or elements to close. String value denoting an interface element. See Selecting Elements No value. If no value supplied, use the last targeted element. If value is supplied, use the element(s) selected by the target instead. See Element Scope Close: {}

Callbacks

Name Description
onClose The callback corresponding to the Close behavior. Fired after the element has been closed.

Demos

See Close Demo