Background image
Purpose
Apply a background image from the given URL in parameter or as per the srcset information.
Use when
- Display a decorative background image
Guidance for publisher
- Ensure the text contrast remains valid in the case where the image doesn't load or takes time to load
- Ensure the image is purely decorative, if not, you can alternatively use the Data Picture plugin
Working example
Evaluation and report
There is no evaluation and report available for this component.
API (Version 1.0)
- Function
- Version 1.0
- Configuration
- Version 1.0
- User interface (Template)
- Version 1.0
- Data source
- Not applicable
- View and style
- Not applicable
- i18n string
- Not applicable
Function
(Version 1.0)
Function type | Name | How to implement | What it does |
---|---|---|---|
jQuery Event | wb-init.wb-bgimg |
Triggered manually (e.g., $( ".wb-bgimg" ).trigger( "wb-init.wb-bgimg" ); ). |
Initializes the bg-img plugin. This plugin will be initialized automatically unless the .wb-bgimg element is added after the page load and wet-boew was initialized. |
jQuery Event | wb-ready.wb-bgimg |
Triggered automatically after the plugin initializes. | Used to identify when and where the plugin initializes (target of the event).
|
Configuration
(Version 1.0)
Option | Description | How to configure | Values |
---|---|---|---|
[data-bgimg] String |
Address of the hyperlinks | Sets the background image URL to specified. | Valid URL pointing to a valid image ressource |
[data-bgimg-srcset] String |
Images to use in different situations, limited to images sizes for different situations. | Set a valid image candidate string. | [ <source-size-value># , ]? <source-size-value> |
User interface (Template)
(Version 1.0)
-
Attribute:
data-bgimg
-
Attribute:
data-bgimg-srcset
Source code
Background image source code on GitHub
- Date modified: