Premium.expand
This component handles creating and closing another iframe panel that overlays the entire hosting website. The HTML file for the expanded overlay is typically placed next to the main creative HTML file(s).
caution
This must always be on the user's explicit interaction and never happen on initial load.
Premium.expand.expand(htmlSrc, iFrameStyle, containingDivStyle, closeDark, closeButtonStyle)
Parameter | Definition |
---|---|
htmlSrc | path to the expandable html (relative to the main creative) required |
iFrameStyle | inline style for the iframe optional |
containingDivStyle | inline style for the containing div overlay optional |
closeDark | true for dark style close button default: false (light style) |
closeButtonStyle | inline style for the close button optional |
Adds an iframe over the whole top window with html content set to the htmlSrc file. A functioning close button is automatically added
Premium.expand.expand('expanded.html', 'width:500px;height:400px');
Premium.expand.callOnLoaded(callback, id)
Parameter | Definition |
---|---|
callback | function to call when loaded required |
id | unique reference required |
Registers a function to be called when the expanded panel is loaded.
Premium.expand.callOnLoaded(function () {
console.log('expanded panel loaded!');
}, 'my-id');
Premium.expand.removeCallOnLoaded(id)
Parameter | Definition |
---|---|
id | unique reference required |
De-registers a function with reference id.
Premium.expand.removeCallOnLoaded('my-id');
Premium.expand.callOnClosed(callback, id)
Parameter | Definition |
---|---|
callback | function to call when closed required |
id | unique reference required |
Registers a function to be called when the expanded panel is closed.
Premium.expand.callOnClosed(function () {
console.log('expanded panel closed!');
}, 'my-id');
Premium.expand.removeCallOnClosed(id)
Parameter | Definition |
---|---|
id | unique reference required |
De-registers a function with reference id.
Premium.expand.removeCallOnClosed('my-id');
Premium.expand.close()
Closes the open expanded panel.
Premium.expand.close();