Skip to main content

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)

ParameterDefinition
htmlSrcpath to the expandable html (relative to the main creative) required
iFrameStyleinline style for the iframe optional
containingDivStyleinline style for the containing div overlay optional
closeDarktrue for dark style close button default: false (light style)
closeButtonStyleinline 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)

ParameterDefinition
callbackfunction to call when loaded required
idunique 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)

ParameterDefinition
idunique reference required

De-registers a function with reference id.

Premium.expand.removeCallOnLoaded('my-id');

Premium.expand.callOnClosed(callback, id)

ParameterDefinition
callbackfunction to call when closed required
idunique 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)

ParameterDefinition
idunique 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();