#

API Docs for: 0.8.7
Show: Inherited Protected Private Deprecated

# NanoScroll Class

Defined in: `bin/javascripts/jquery.nanoscroller.js:354`

## Constructor

### `NanoScroll`

(

- `element`
- `options`

)

Defined in `bin/javascripts/jquery.nanoscroller.js:354`

#### Parameters:

- `element` HTMLElement | Node

  the main element

- `options` Object

  nanoScroller's options

- Index
- Methods
- Properties

## Item Index

### Methods

- addEvents
- createEvents
- destroy
- flash
- generate
- getBrowserScrollbarWidth static
- nativeScrolling
- preventScrolling
- removeEvents
- reset
- restore
- scroll
- scrollBottom
- scrollTo
- scrollTop
- setOnScrollStyles
- stop
- updateScrollValues

### Properties

- alwaysVisible
- BROWSER_IS_IE7 static
- BROWSER_SCROLLBAR_WIDTH static
- contentClass
- disableResize
- documentContext
- DOMSCROLL static
- DOWN static
- DRAG static
- ENTER static
- flashDelay
- iOSNativeScrolling
- KEYDOWN static
- KEYUP static
- MOUSEDOWN
- MOUSEENTER
- MOUSEMOVE static
- MOUSEUP static
- MOUSEWHEEL
- paneClass
- PANEDOWN static
- preventPageScrolling
- RESIZE
- SCROLL static
- SCROLLBAR static
- sliderClass
- sliderMaxHeight
- sliderMinHeight
- TOUCHMOVE static
- UP static
- WHEEL static
- windowContext

## Methods

### `addEvents`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:603`

Adds event listeners with jQuery.

### `createEvents`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:489`

Creates event related methods

### `destroy`

() chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:875`

Destroys nanoScroller and restores browser's native scrollbar.

#### Example:

    $(".nano").nanoScroller({ destroy: true });

### `flash`

() chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:904`

To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s). Useful if you want to show the user (e.g. on pageload) that there is more content waiting for him.

#### Example:

    $(".nano").nanoScroller({ flash: true });

### `generate`

() private chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:642`

Generates nanoScroller's scrollbar and elements for it.

### `getBrowserScrollbarWidth`

() Number private static

Defined in `bin/javascripts/jquery.nanoscroller.js:319`

Returns browser's native scrollbar width

#### Returns:

Number:

the scrollbar width in pixels

### `nativeScrolling`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:412`

Enable iOS native scrolling

### `preventScrolling`

(

- `event`
- `direction`

)
private

Defined in `bin/javascripts/jquery.nanoscroller.js:384`

Prevents the rest of the page being scrolled when user scrolls the `.nano-content` element.

#### Parameters:

- `event` Event
- `direction` String

  Scroll direction (up or down)

### `removeEvents`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:624`

Removes event listeners with jQuery.

### `reset`

() chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:691`

Resets nanoScroller's scrollbar.

#### Example:

    $(".nano").nanoScroller();

### `restore`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:677`

### `scroll`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:774`

#### Example:

    $(".nano").nanoScroller({ scroll: 'top' });

### `scrollBottom`

(

- `offsetY`

)
chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:796`

Scroll at the bottom with an offset value

#### Parameters:

- `offsetY` Number

#### Example:

    $(".nano").nanoScroller({ scrollBottom: value });

### `scrollTo`

(

- `node`

)
chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:834`

Scroll to an element

#### Parameters:

- `node` Node

  A node to scroll to.

#### Example:

    $(".nano").nanoScroller({ scrollTo: $('#a_node') });

### `scrollTop`

(

- `offsetY`

)
chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:815`

Scroll at the top with an offset value

#### Parameters:

- `offsetY` Number

#### Example:

    $(".nano").nanoScroller({ scrollTop: value });

### `setOnScrollStyles`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:456`

Updates CSS styles for current scroll position. Uses CSS 2d transfroms and `window.requestAnimationFrame` if available.

### `stop`

() chainable

Defined in `bin/javascripts/jquery.nanoscroller.js:852`

To stop the operation. This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI.

#### Example:

    $(".nano").nanoScroller({ stop: true });

### `updateScrollValues`

() private

Defined in `bin/javascripts/jquery.nanoscroller.js:427`

Updates those nanoScroller properties that are related to current scrollbar position.

## Properties

### `alwaysVisible`

Boolean

Defined in `bin/javascripts/jquery.nanoscroller.js:68`

a setting to make the scrollbar always visible.

Default: false

### `BROWSER_IS_IE7`

Boolean private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:275`

### `BROWSER_SCROLLBAR_WIDTH`

Number private static

Defined in `bin/javascripts/jquery.nanoscroller.js:284`

Default: null

### `contentClass`

String

Defined in `bin/javascripts/jquery.nanoscroller.js:35`

a classname for the content element.

Default: 'nano-content'

### `disableResize`

Boolean

Defined in `bin/javascripts/jquery.nanoscroller.js:60`

a setting to disable binding to the resize event.

Default: false

### `documentContext`

Document

Defined in `bin/javascripts/jquery.nanoscroller.js:100`

an alternate document context.

Default: null

### `DOMSCROLL`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:221`

### `DOWN`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:230`

### `DRAG`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:185`

### `ENTER`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:194`

### `flashDelay`

Number

Defined in `bin/javascripts/jquery.nanoscroller.js:76`

a default timeout for the `flash()` method.

Default: 1500

### `iOSNativeScrolling`

Boolean

Defined in `bin/javascripts/jquery.nanoscroller.js:43`

a setting to enable native scrolling in iOS devices.

Default: false

### `KEYDOWN`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:248`

### `KEYUP`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:257`

### `MOUSEDOWN`

String private final

Defined in `bin/javascripts/jquery.nanoscroller.js:135`

### `MOUSEENTER`

String private final

Defined in `bin/javascripts/jquery.nanoscroller.js:143`

### `MOUSEMOVE`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:151`

### `MOUSEUP`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:168`

### `MOUSEWHEEL`

String private final

Defined in `bin/javascripts/jquery.nanoscroller.js:160`

### `paneClass`

String

Defined in `bin/javascripts/jquery.nanoscroller.js:19`

a classname for the pane element.

Default: 'nano-pane'

### `PANEDOWN`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:212`

### `preventPageScrolling`

Boolean

Defined in `bin/javascripts/jquery.nanoscroller.js:51`

a setting to prevent the rest of the page being scrolled when user scrolls the `.content` element.

Default: false

### `RESIZE`

String private final

Defined in `bin/javascripts/jquery.nanoscroller.js:177`

### `SCROLL`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:126`

### `SCROLLBAR`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:117`

### `sliderClass`

String

Defined in `bin/javascripts/jquery.nanoscroller.js:27`

a classname for the slider element.

Default: 'nano-slider'

### `sliderMaxHeight`

Number

Defined in `bin/javascripts/jquery.nanoscroller.js:92`

a maximum height for the `.slider` element.

Default: null

### `sliderMinHeight`

Number

Defined in `bin/javascripts/jquery.nanoscroller.js:84`

a minimum height for the `.slider` element.

Default: 20

### `TOUCHMOVE`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:266`

### `UP`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:203`

### `WHEEL`

String private final static

Defined in `bin/javascripts/jquery.nanoscroller.js:239`

### `windowContext`

Window

Defined in `bin/javascripts/jquery.nanoscroller.js:108`

an alternate window context.

Default: null