Personal tools
Views

From ProtoScript

Jump to: navigation, search

Contents

YUI:Dblclick Behavior

Adds a double-click event to the current behavior or callback.

Example

$proto('img#avatar', {
  Dblclick: {
     onDblclick: {
        Fade: {
           opacity: {to: 0}
        }
     }	
  },
});


When the user double-clicks on the avatar image (img with ID='avatar'), fade it completely out.

Attributes

Name Description Default Valid Values Example
target Selected element or elements to attach a double-click event to. See Element Scope Inherited from parent behavior. If no value supplied, use the last targeted element. If value is supplied, use the element(s) selected by the target instead. String value denoting an interface element. target:'#avatar'
modifier Name of modifier key that must be pressed for the event to fire 'shift', 'alt', 'ctrl' no value modifier: 'alt'
delay Amount of time (in seconds) to delay before firing the callback. No delay is set. number delay: 0.5

Callbacks

Name Description
onDblclick The callback corresponding to the Dblclick behavior. Fired when a mouse double-click happens on the target. If the modifier attribute is supplied, then the given modifier key must be pressed also.

Demos

See Dblclick Demo