new Responsiville.Lazymg(options)
Lazy loading images 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.Lazymg.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.Lazymg.defaults
-
Properties:
Name Type Description defaults
Object Default values for this module settings.
Methods
-
staticResponsiville.Lazymg.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 -
staticResponsiville.Lazymg.getElement()
-
Returns the element of interest, that is the image being handled for lazy loading wrapped in jQuery.
Returns:
void -
appearImageByCSSBg(){void}
-
The function that runs when the image first appears, ie enters the browser viewport. It sets the image src attribute back to what is was meant to be in the first place.
Fires:
- Responsiville.Lazymg#event:appear
Returns:
Type Description void -
appearImageBySrc(){void}
-
The function that runs when the image first appears, ie enters the browser viewport. It sets the image src attribute back to what is was meant to be in the first place.
Fires:
- Responsiville.Lazymg#event:appear
Returns:
Type Description void -
disable(){void}
-
Disables the lazy image. It does not deactivate it. It simply disables it, so it does not function any more when the necessary trigger is fired. Useful in responsive design where the lazy image might be a required feature in desktops but useless in mobile devices.
Fires:
Returns:
Type Description void -
enable(){void}
-
Enables the lazy image. It does not activate it. It simply enables it, so when the necessary trigger is fired then the lazy image behaviour begins. Useful in responsive design where the lazy image might be a required feature in desktops but useless in mobile devices.
Fires:
Returns:
Type Description void -
setupEvents(){void}
-
Sets up event handlers necessary for the object to function properly.
Returns:
Type Description void
Events
-
disabled
-
Called after the lazymg scroll has been disabled.
-
enabled
-
Called after the lazymg scroll has been enabled.
-
enabled
-
Called after the lazymg scroll has been enabled.
-
enabled
-
Called after the lazymg scroll has been enabled.
-
Called after the lazymg has been created.