# Yahoo! UI Library

### scrollview-scrollbars 3.3.0

Yahoo! UI Library > scrollview-scrollbars > Plugin.ScrollViewScrollbars
Search:
Filters Show Private Show Protected Show Deprecated

## Class Plugin.ScrollViewScrollbars - extends Plugin.Base

ScrollView plugin that adds scroll indicators to ScrollView instances

### Constructor

Plugin.ScrollViewScrollbars `( )`

### Properties

#### ScrollViewScrollbars.ATTRS - `static Object`

The default attribute configuration for the plugin

#### ScrollViewScrollbars.NAME - `static String`

The identity of the plugin
Default Value: 'pluginScrollViewScrollbars'

#### ScrollViewScrollbars.NS - `static String`

The namespace on which the plugin will reside.
Default Value: 'scrollbars'

#### ScrollViewScrollbars.SCROLLBAR_TEMPLATE - `static Object`

HTML template for the scrollbar

#### Properties inherited from Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Base:

`name`

#### Properties inherited from Plugin.Base:

`_handles`

### Methods

#### _clearChildCache

`private void _clearChildCache ( node )`
Clears child cache

Parameters:
  `node <Node>`

#### _defaultNode

`protected Node _defaultNode ( )`
Creates default node instances for scrollbars

Returns: `Node`
  The Y.Node instance for the scrollbar

#### _hostDimensionsChange

`protected void _hostDimensionsChange ( )`
Set up the DOM nodes for the scrollbars. This method is invoked whenever the host's _uiDimensionsChange fires, giving us the opportunity to remove un-needed scrollbars, as well as add one if necessary.

#### _hostScrollEnd

`void _hostScrollEnd ( e )`
Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar

Parameters:
  `e <Event.Facade>` The event facade.

#### _renderBar

`private void _renderBar ( bar , add )`
Adds or removes a scrollbar node from the document.

Parameters:
  `bar <Node>` The scrollbar node
  `add <boolean>` true, to add the node, false to remove it

#### _setChildCache

`private void _setChildCache ( node )`
Caches scrollbar child element information, to optimize _update implementation

Parameters:
  `node <Node>`

#### _setNode

`protected Node _setNode ( node , name )`
Setter for the verticalNode and horizontalNode attributes

Parameters:
  `node <Node>` The Y.Node instance for the scrollbar
  `name <String>` The attribute name

Returns: `Node`
  The Y.Node instance for the scrollbar

#### _show

`protected void _show ( show , animated )`
Internal hide/show implementation utility method

Parameters:
  `show <boolean>` Whether to show or hide the scrollbar
  `animated <bolean>` Whether or not to animate while showing/hide

#### _update

`protected void _update ( x , y , duration , easing )`
AOP method, invoked after the host's _uiScrollTo method, to position and resize the scroll bars

Parameters:
  `x <Number>` The current scrollX value
  `y <Number>` The current scrollY value
  `duration <Number>` Number of ms of animation (optional) - used when snapping to bounds
  `easing <String>` Optional easing equation to use during the animation, if duration is set

#### _updateBar

`private void _updateBar ( scrollbar , current , duration , horiz )`
Utility method, to move/resize either vertical or horizontal scrollbars

Parameters:
  `scrollbar <Node>` The scrollbar node.
  `current <Number>` The current scroll position.
  `duration <Number>` The transition duration.
  `horiz <boolean>` true if horizontal, false if vertical.

#### flash

`void flash ( )`
Momentarily flash the scroll bars to indicate current scroll position

#### hide

`void hide ( animated )`
Hide the scroll bar indicators

Parameters:
  `animated <Boolean>` Whether or not to animate the hiding

#### initializer

`void initializer ( )`
Designated initializer

#### show

`void show ( animated )`
Show the scroll bar indicators

Parameters:
  `animated <Boolean>` Whether or not to animate the showing

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

#### Methods inherited from Plugin.Base:

`afterHostEvent, afterHostMethod, beforeHostMethod, destructor, doAfter, doBefore, initializer, onHostEvent`

### Events

#### horizontalNodeChange

`horizontalNodeChange ( event )`
Fires when the value for the configuration attribute 'horizontalNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### verticalNodeChange

`verticalNodeChange ( event )`
Fires when the value for the configuration attribute 'verticalNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### Events inherited from Base:

`destroy, destroyedChange, init, initializedChange,`

#### Events inherited from Plugin.Base:

`hostChange,`

### Configuration Attributes

#### horizontalNode `- Y.Node`

Horizontal scrollbar node

#### verticalNode `- Y.Node`

Vertical scrollbar node

#### Configuration attributes inherited from Base:

`destroyed initialized`

#### Configuration attributes inherited from Plugin.Base:

`host`

Copyright © 2011 Yahoo! Inc. All rights reserved.