Represents a banner.
Class constructor.
parameter | type | default | description |
---|---|---|---|
bannerElement (optional) | HTMLElement | The banner element in the DOM | |
options (optional) | object | {} | An options object for configuring the banner |
Build a full banner element. This is used when no banner or a partial banner exists in the DOM.
parameter | type | default | description |
---|---|---|---|
bannerElement (optional) | HTMLElement | The banner element to build around |
Build a close button element.
Get the data attributes from the bannerElement. If the banner is being set up declaratively, this method is used to extract the data attributes from the DOM.
parameter | type | default | description |
---|---|---|---|
bannerElement | HTMLElement | The banner element in the DOM |
Initialise banner components.
parameter | type | default | description |
---|---|---|---|
rootElement (optional) | HTMLElement | string | The root element to intialise banners in, or a CSS selector for the root element | |
options (optional) | object | {} | An options object for configuring the banners |
Represents a banner.
Class constructor.
parameter | type | default | description |
---|---|---|---|
bannerElement (optional) | HTMLElement | The banner element in the DOM | |
options (optional) | object | {} | An options object for configuring the banner |
If using the Build Service, add o-banner@^4.3.1
to your
script and link tags.
If using the npm package manager for a Manual Build, run npm install --save-peer "@financial-times/o-banner@^4.3.1"
.
o-banner is maintained directly by the Origami team. If you have any questions about o-banner or Origami in general, we are happy to help. 😊
Slack: #origami-support
Email: origami.support@ft.com
To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊
Slack: #origami-support
Email: origami.support@ft.com