When entering the page, a user sees the initially collapsed banner. Transition to the expanded banner can be carried out with a click or on the mouse-over. When unfolding, the screenshot of the content is rotated, revealing an expanded banner.
A container with Takeover animation can only use part of the site content, for example, central, without side columns. In this case, for the container, the necessary dimensions and position are specified, and the animation will only work for the specified part. Takeover example with horizontal rotation.
Desktop | Tablet | Phone | |||
---|---|---|---|---|---|
Windows | Mac | iOS | Android | iOS | Android |
Chrome, Firefox | Safari9+, Chrome, Firefox | – | – | – | – |
Banner with all banner assets should be archived as a .zip file. It is recommended to use a .zip file with the template.
The HTML file must define all used sources (libraries, images, etc). A recommended file name is body.html.
globalHTML5Api connects automatically, requested using the following method:
All used modules should be listed as function parameters. Two and more modules should be comma-separated. In this format, the Player and Takeover modules may be used.
A simplified example of the globalHTML5Api.init usage for the Takeover format:
Key | Parameters | Properties | Type | Description | ||
---|---|---|---|---|---|---|
resize(options) | – | – | – | globalHTML5Api.resize initialization | ||
options | – | Array | An array of objects with properties. Each object presents the container state (resizeState) | |||
name (required) | String | Object (state) name | ||||
width (required) | String|Number | Banner container width | ||||
height (required) | String|Number | Banner container height | ||||
fixed | – | Object | Object with properties. Describes the container position relatively to the browser window | |||
vertical (required) | center | String | The vertical alignment of the container | |||
horizontal (required) | center | String | The horizontal alignment of the container | |||
onComplete | Function | Callback function running upon completion of globalHTML5Api.init.resize.to(this.name) | ||||
onStart | Function | Callback function running upon starting of globalHTML5Api.init.resize.to(this.name) |
Method | Parameters | Type | Description |
---|---|---|---|
to(resizeStateName, time, eventName) | – | – | Changing the current container state to indicated one |
resizeStateName (required) | String | Container state to which the current one should be switched to | |
time (required) | Number | Time for the container state-changing animation | |
eventName (required) | String | Events for tracking:
|
|
currentState() | – | – | The method returns the string: resizeState.name – current container state name interactive to resizeState.name – changing the container state to the indicated one |
A simplified example of using the Takeover module:
Method | Parameters | Properties | Type | Description | ||
---|---|---|---|---|---|---|
create() | — | — | — | Takeover initialization | ||
container(HTMLElement) | — | — | — | A method that adds Takeover to the specified container | ||
HTMLElement | — | String | HTML element with the Takeover layout show | |||
show(“rotate”, options) | — | — | — | The method starts Takeover animation | ||
rotate | — | String | Takeover animation type | |||
options | — | Object | An object with properties | |||
target (required) | horizontal, vertical | String | Direction of rotation of the screenshot of the site content | |||
time (required) | Number | The time for which Takeover animation is performed; sec | ||||
degree (required) | Number | Rotation angle | ||||
backside (required) | HTMLElement | The container with the Takeover layout. It will be shown after the rotation of a content of a site. | ||||
overflow (optional) | Boolean | Default value – false. Overlap of the site content by the container with Takeover layout. It’s recommended to use while rotating the container horizontally (target: “horizontal”). | ||||
onStart (optional) | Function | Calling the function at the start of the Takeover animation | ||||
onComplete (optional) | Function | Calling the function at the completion of the Takeover animation | ||||
hide(timeScale) | — | — | — | The method starts the Takeover animation in the opposite direction | ||
timeScale (optional) | — | Number | The value acts as a multiplier for time, accelerates or slows down the animation while minimizing Takeover |
|||
on(“ready”, callback) | — | — | — | The method allows you to call functions on the readiness of the screenshot of the site content ready | ||
ready | — | String | Event that occurs when a screenshot of the site is available | |||
callback | — | Function | The function, which starts when the screenshot of the site is available |
Method | Arguments | Type | Description |
---|---|---|---|
click(URL) | – | – | Method to call the clickthrough. Target URL may be set as a parameter or from the user interface. <_The URL set in the code has a higher priority than the URL set from the UI, which can lead to a conflict. Therefore, it is mandatory to use only one of the available methods_. |
URL (optional) | String | Target URL | |
src(URL) | – | – | The method returns the absolute path to file |
URL (optional) | String | Relative path to file |
In case the creative contains video, see the Video player module page.
Supported file types: .jpg, .png, .gif, .svg