Jump To:

  1. ui/scrollpoint.Scrollpoint
    1. new exports.Scrollpoint(element, config)
    2. scrollpoint.onObserve()
  2. ui/scrollpoint.initializer
  3. ui/scrollpoint.init()
  4. ui/scrollpoint~root
  5. ui/scrollpoint~rootSelector
  6. ui/scrollpoint~debug
  7. ui/scrollpoint~horizontal
  8. ui/scrollpoint~marginStart
  9. ui/scrollpoint~marginEnd
  10. ui/scrollpoint~threshold
  11. ui/scrollpoint~exit
  12. ui/scrollpoint~exitForward
  13. ui/scrollpoint~exitReverse
  14. ui/scrollpoint~setClasses
  15. ui/scrollpoint~classPrefix
  16. ui/scrollpoint~setAttribute
  17. ui/scrollpoint~attributeName
  18. ui/scrollpoint~syncElements
  19. ui/scrollpoint~onChange()

ui/scrollpoint

Module that uses intersection observer to add scrollpoint like behavior.

ui/scrollpoint.Scrollpoint

Single scrollpoint

  • Note "forward" and "reverse" refer to scroll directions
    • forward = vertical below / horizontal right
    • reverse = vertical above / horizontal left

Kind: static class of ui/scrollpoint
Todo

  • [ ] Convert margin to offset
  • [ ] This only goes one direction

new exports.Scrollpoint(element, config)

Setup a new scrollpoint

Param Type Description
element Node The element to create the scrollpoint for
config Object Options to configure the scrollpoint see Scrollpoint.defaults for more information on settings

scrollpoint.onObserve()

IntersectionObserver Callback

  • Should set the state

Kind: instance method of Scrollpoint

ui/scrollpoint.initializer

Scrollpoint Component Initializer

Kind: static constant of ui/scrollpoint

ui/scrollpoint.init()

Initialize everything in document

  • This will only initialize elements once, it is safe to call on page changes

Kind: static method of ui/scrollpoint

ui/scrollpoint~root

Default observer root element

Kind: inner property of ui/scrollpoint

ui/scrollpoint~rootSelector

Use a selector to select the observer root element

Kind: inner property of ui/scrollpoint

ui/scrollpoint~debug

Log debug info to console

Kind: inner property of ui/scrollpoint

ui/scrollpoint~horizontal

Change scroll orientation to horizontal

Kind: inner property of ui/scrollpoint

ui/scrollpoint~marginStart

Margin for observer top or left (depending on orientation)

Kind: inner property of ui/scrollpoint

ui/scrollpoint~marginEnd

Margin for observer bottom or right (depending on orientation)

Kind: inner property of ui/scrollpoint

ui/scrollpoint~threshold

Threshold for observer

Kind: inner property of ui/scrollpoint

ui/scrollpoint~exit

The point can exited (else persists)

Kind: inner property of ui/scrollpoint

ui/scrollpoint~exitForward

The point can exit from the end

Kind: inner property of ui/scrollpoint

ui/scrollpoint~exitReverse

The point can exit from the start

Kind: inner property of ui/scrollpoint

ui/scrollpoint~setClasses

Set state classes

Kind: inner property of ui/scrollpoint

ui/scrollpoint~classPrefix

Prefix for classes

Kind: inner property of ui/scrollpoint

ui/scrollpoint~setAttribute

Set attribute for state (less verbose same info as classes)

Kind: inner property of ui/scrollpoint

ui/scrollpoint~attributeName

Attribute name to set state info in

Kind: inner property of ui/scrollpoint

ui/scrollpoint~syncElements

Elements that should also get active state info (classes or attributes)

Kind: inner property of ui/scrollpoint

ui/scrollpoint~onChange()

Callback called when state changes

Kind: inner method of ui/scrollpoint