Plugin.Affix Class
A plugin that makes a node stick to a position when it scrolls over a certain offset. Based on Bootstrap's Affix plugin.
Constructor
Plugin.Affix
(
-
config
Parameters:
-
config
ObjectObject literal containing configuration options
-
host
ObjectNode or widget (the boundingBox will be used)
-
[offset]
Object | Number optionalThe offset to use. If not found it will default to data-offset-top, data-offset-left or data-offset properties on the host
-
[left]
Number optionalLeft offset to use. At least one of top or left should be used -
[top]
Number optionalTop offset to use.
-
-
Methods
_getNode
()
private
Get the correct node when plugged in Nodes or Widgets
Returns:
Node
refresh
()
Fixes or releases the node according to the scroll position. Called automatically when scrolling.
Properties
_handle
Object
private
Event handle for the document's scroll
event.
_x
Number
private
The original left position of the node. Used to calculate if the node is over the offset.
_y
Number
private
The original top position of the node. Used to calculate if the node is over the offset.
NS
String
static
Plugin namespace
Default: "affix"