new Responsiville.Scrollmenu(options)
Creates and initialises the scrollmenu.
Name | Type | Description |
---|---|---|
options |
Object | The initialisation options of the module. |
- License:
- Nevma Copyright (c) http://www.nevma.gr
Properties:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The options that define the object
behaviour.
Properties
|
Fires:
- Responsiville.Scrollmenu#event:init
Extends
Members
-
staticResponsiville.Scrollmenu.AUTO_RUN
-
Properties:
Name Type Description AUTO_RUN
boolean Controls whether this module should run by default, without the developer calling it, using its default settings. Defaults to true. -
staticResponsiville.Scrollmenu.defaults
-
Properties:
Name Type Description defaults
Object Default values for this module settings.
Methods
-
staticResponsiville.Scrollmenu.autoRun(){void}
-
Runs through the page and searches for elements that apply to the current module in order to apply it to them automatically. Useful for automatically creating elements with this module's behaviour just by setting up the predefined classes and data attributes in HTML elements of the page.
Returns:
Type Description void -
activate(){void}
-
Activates the scrollmenu, which means fixes it on top of the screen as the user keeps scrolling down.
Fires:
Returns:
Type Description void -
deactivate(){void}
-
Deactivates the scrollmenu, which means restoring it to its original state.
Fires:
Returns:
Type Description void -
disable(){void}
-
Disables the scrollmenu. It does not deactivate it, it does not close it. It simply disables it, so it does not function any more when the necessary trigger is fired. Useful in responsive web design.
Fires:
Returns:
Type Description void -
enable(){void}
-
Enables the scrollmenu. It does not activate it, it does not open it. It simply enables it, so when the necessary trigger is fired (ie the user scrolls down enough for the element to be hidden) then the element is activated (which means it is fixed at the top of the screen). Useful in responsive web design.
Fires:
Returns:
Type Description void -
scroll(){void}
-
Window scroll event handler which checks when the scrollmenu should be activated and deactivated. Can also be called on demand, if necessary.
Returns:
Type Description void -
setupEvents(){void}
-
Sets up event handlers necessary for the object to function properly.
Returns:
Type Description void
Events
-
activated
-
Called after the scrollmenu has been activated.
-
activating
-
Called before the scrollmenu has been activated.
-
created
-
Called after the scrollmenu has been created.
-
deactivated
-
Called after the scrollmenu has been deactivated.
-
deactivating
-
Called before the scrollmenu has been deactivated.
-
disabled
-
Called after the scrollmenu has been disabled.
-
enabled
-
Called after the scrollmenu has been enabled.