φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • core
  • Context
  • ElementAllocator
  • ElementOutput
  • Engine
  • Entity
  • EventEmitter
  • EventHandler
  • Group
  • Modifier
  • OptionsManager
  • RenderNode
  • Scene
  • SpecParser
  • Transform
  • View
  • ViewSequence
  • events
  • EventArbiter
  • EventFilter
  • EventMapper
  • inputs
  • Accumulator
  • GenericSync
  • MouseSync
  • PinchSync
  • RotateSync
  • ScaleSync
  • ScrollSync
  • TouchSync
  • TouchTracker
  • TwoFingerSync
  • math
  • Matrix
  • Quaternion
  • Random
  • Utilities
  • Vector
  • modifiers
  • Draggable
  • Fader
  • ModifierChain
  • StateModifier
  • physics
  • PhysicsEngine
  • physics/bodies
  • Body
  • Circle
  • Particle
  • Rectangle
  • physics/constraints
  • Surface
  • Collision
  • Constraint
  • Curve
  • Distance
  • Snap
  • Wall
  • Walls
  • physics/forces
  • Drag
  • Force
  • Repulsion
  • RotationalDrag
  • RotationalSpring
  • Spring
  • VectorField
  • physics/integrators
  • SymplecticEuler
  • surfaces
  • CanvasSurface
  • ContainerSurface
  • ImageSurface
  • InputSurface
  • TextareaSurface
  • VideoSurface
  • transitions
  • CachedMap
  • Easing
  • MultipleTransition
  • SnapTransition
  • SpringTransition
  • Transitionable
  • TransitionableTransform
  • TweenTransition
  • WallTransition
  • utilities
  • KeyCodes
  • Timer
  • Utility
  • views
  • ContextualView
  • Deck
  • DrawerLayout
  • EdgeSwapper
  • FlexibleLayout
  • Flipper
  • GridLayout
  • HeaderFooterLayout
  • Lightbox
  • RenderController
  • ScrollContainer
  • Scroller
  • Scrollview
  • SequentialLayout
  • widgets
  • NavigationBar
  • TabBar

Scrollview

Scrollview will lay out a collection of renderables sequentially in the specified direction, and will allow you to scroll through them with mousewheel or touch events.

Overview

Options
direction
rails
Methods
getCurrentIndex
goToPreviousPage
goToNextPage
goToPage
getPosition
getAbsolutePosition
getOffset
setPosition
setPosition
getVelocity
setVelocity
setOptions
sequenceFrom
getSize

Scrollview(options, clipSize, margin, friction, drag, edgeGrip, egePeriod, edgeDamp, paginated, pagePeriod, pageDamp, pageStopSpeed, pageSwitchSpeed, speedLimit)

Constructor Parameters

options

Options

An object of configurable options.

direction
Number
Using the direction helper found in the famous Utility module, this option will lay out the Scrollview instance's renderables either horizontally (x) or vertically (y). Utility's direction is essentially either zero (X) or one (Y), so feel free to just use integers as well.
rails
Boolean
When true, Scrollview's genericSync will only process input in it's primary access.

clipSize

Number

The size of the area (in pixels) that Scrollview will display content in.

margin

Number

The size of the area (in pixels) that Scrollview will process renderables' associated calculations in.

friction

Number

Input resistance proportional to the velocity of the input. Controls the feel of the Scrollview instance at low velocities.

drag

Number

Input resistance proportional to the square of the velocity of the input. Affects Scrollview instance more prominently at high velocities.

edgeGrip

Number

A coefficient for resistance against after-touch momentum.

egePeriod

Number

Sets the period on the spring that handles the physics associated with hitting the end of a scrollview.

edgeDamp

Number

Sets the damping on the spring that handles the physics associated with hitting the end of a scrollview.

paginated

Boolean

A paginated scrollview will scroll through items discretely rather than continously.

pagePeriod

Number

Sets the period on the spring that handles the physics associated with pagination.

pageDamp

Number

Sets the damping on the spring that handles the physics associated with pagination.

pageStopSpeed

Number

The threshold for determining the amount of velocity required to trigger pagination. The lower the threshold, the easier it is to scroll continuosly.

pageSwitchSpeed

Number

The threshold for momentum-based velocity pagination.

speedLimit

Number

The highest scrolling speed you can reach.

Methods

getCurrentIndex()

Returns the index of the first visible renderable

Returns
Number
The current index of the ViewSequence

goToPreviousPage()

goToPreviousPage paginates your Scrollview instance backwards by one item.

Returns
ViewSequence
The previous node.

goToNextPage()

goToNextPage paginates your Scrollview instance forwards by one item.

Returns
ViewSequence
The next node.

goToPage()

Paginates the Scrollview to an absolute page index.

getPosition(node)Deprecated

Returns the position associated with the Scrollview instance's current node (generally the node currently at the top).

Parameters
node
Number
If specified, returns the position of the node at that index in the Scrollview instance's currently managed collection.
Returns
Number
The position of either the specified node, or the Scrollview's current Node, in pixels translated.

getAbsolutePosition()

Returns the absolute position associated with the Scrollview instance

Returns
Number
The position of the Scrollview's current Node, in pixels translated.

getOffset(node)

Returns the offset associated with the Scrollview instance's current node (generally the node currently at the top).

Parameters
node
Number
If specified, returns the position of the node at that index in the Scrollview instance's currently managed collection.
Returns
Number
The position of either the specified node, or the Scrollview's current Node, in pixels translated.

setPosition(x)Deprecated

Sets the position of the physics particle that controls Scrollview instance's "position"

Parameters
x
Number
The amount of pixels you want your scrollview to progress by.

setPosition(x)

Sets the offset of the physics particle that controls Scrollview instance's "position"

Parameters
x
Number
The amount of pixels you want your scrollview to progress by.

getVelocity()

Returns the Scrollview instance's velocity.

Returns
Number
The velocity.

setVelocity(v)

Sets the Scrollview instance's velocity. Until affected by input or another call of setVelocity the Scrollview instance will scroll at the passed-in velocity.

Parameters
v
Number
The magnitude of the velocity.

setOptions(options)

Patches the Scrollview instance's options with the passed-in ones.

Parameters
options
Options
An object of configurable options for the Scrollview instance.

sequenceFrom(node)

Sets the collection of renderables under the Scrollview instance's control, by setting its current node to the passed in ViewSequence. If you pass in an array, the Scrollview instance will set its node as a ViewSequence instantiated with the passed-in array.

Parameters
node
Array|ViewSequence
Either an array of renderables or a Famous viewSequence.

getSize()

Returns the width and the height of the Scrollview instance.

Returns
Array
A two value array of the Scrollview instance's current width and height (in that order).

render()Private

Generate a render spec from the contents of this component.

Returns
Number
Render spec for this component
Branding Terms Privacy Jobs © Famous Industries, Inc. 2015