new Responsiville.Responsiveelement(options)
Responsive elements utility.
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:
Extends
Members
-
staticResponsiville.Responsiveelement.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.Responsiveelement.defaults
-
Properties:
Name Type Description defaults
Object Default values for this module settings.
Methods
-
staticResponsiville.Responsiveelement.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 -
disable(){void}
-
Disables the responsive element.
Fires:
Returns:
Type Description void -
enable(){void}
-
Enables the responsive element.
Fires:
Returns:
Type Description void -
imageError(event){void}
-
Runs when an image inside the responsive element has aborted loading due to any error.
Name Type Description event
Event The image error event that originally fired. Fires:
Returns:
Type Description void -
imageLoaded(event){void}
-
Callback that runs when an image inside the responsive element has successfully loaded.
Name Type Description event
Event The image loaded event that originally fired. Fires:
Returns:
Type Description void -
processElement(){void}
-
Does whatever necessary on the element in order to satisfy its responsive behaviour. Runs on window resize events and on Responsiville resize and breakpoint change events.
Fires:
- Responsiville.Responsiveelement#image.event:processing
- Responsiville.Responsiveelement#image.event:change
- Responsiville.Responsiveelement#image.event:processed
Returns:
Type Description void -
runBreakpointChangeCallbacks(){void}
-
Runs all the callback functions registered on the responsive element's breakpoint changes.
Returns:
Type Description void -
setupEvents(){void}
-
Sets up event handlers necessary for the object to function properly.
Returns:
Type Description void
Events
-
Called after a breakpoint change has occured.
-
disabled
-
Called after the module has been disabled.
-
Called after the module has been enabled.
-
Called after the module has been initialised.
-
processing
-
Called before processing a responsive element.