new Banner(element, options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | DOM element for component instantiation and scope |
|||||||||||||||||||||||||||||||||
options |
Object |
Properties
|
Classes
Methods
checkViewport()
destroy()
handleCtaClick(Event)
Parameters:
Name | Type | Description |
---|---|---|
Event |
e |
Fires:
- Banner#event:onCtaClick
handlePauseClick(Event)
Parameters:
Name | Type | Description |
---|---|---|
Event |
e |
Fires:
handlePlayClick(Event)
Parameters:
Name | Type | Description |
---|---|---|
Event |
e |
Fires:
- Banner#event:onPlayClick
handleResize()
init()
on(eventName, callback) → {void}
Example
// Registering a callback for the 'onCtaClick' event
banner.on('onCtaClick', (event) => {
console.log('The cta was clicked', event);
});
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | The name of the event to listen for. |
callback |
function | The callback function to be invoked when the event occurs. |
Returns:
- Type
- void
resetBannerHeight()
setBannerHeight()
setHeight(aspect)
Parameters:
Name | Type | Description |
---|---|---|
aspect |
string | ratio |
trigger(eventName, eventData)
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | The name of the event to trigger. |
eventData |
any | Data associated with the event. |
waitForAspectRatioToBeDefined()
(static) autoInit(root) → {Banner}
Parameters:
Name | Type | Description |
---|---|---|
root |
HTMLElement | DOM element for component instantiation and scope |
Returns:
An instance of Banner.
- Type
- Banner
Events
onPauseClick
Type:
- Array.<string>