Personal tools
Views

From ProtoScript

Jump to: navigation, search

Contents

YUI:Blur Behavior

Adds a blur event to the current behavior or callback. Blur means the element or elements have lost focus. Opposite of the Focus Behavior.

Example

$proto('input#firstName', {
  Blur: {
     onBlur: {
        Fade: {
           opacity: {to: 0.5}
        }
     }
  },
});


When the user tabs out (or changes focus) of the input field with ID='firstName', fade the input field to half transparent.

Attributes

Name Description Default Valid Values Example
target Selected element or elements to attach the behavior to. 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 String value denoting an interface element. Inherited from parent behavior target: '#avatar'
delay Amount of time (in seconds) to delay before firing the callback. No delay is set. number delay: 0.5

Callbacks

Name Description
onBlur The callback corresponding to the Blur behavior. Fired when the target loses focus.

Demos

See Blur Demo