UI template: HTML5 Mobile Float
A fullscreen mobile format that makes the user interact with a banner. The user should shake their phone to do some action.
Desktop | Tablet | Phone | |||
---|---|---|---|---|---|
Windows | Mac | iOS | Android | iOS | Android |
– | – | ver. 8.0+ | ver. 5+ | ver. 8.0+ | ver. 5+ |
Motion and Orientation settings on mobile devices with iOS 12 and higher can be off by default. In this case, the shake module will show each panel automatically every five seconds
Additionally, you can check the preview of the creative by copying the link to it and viewing it from your mobile device.
Standard dimensions, WxH, 100%x100%
A banner with all banner assets should be archived as a .zip file. Use a .zip file with a template.
The HTML file must define all used sources (libraries, images etc). A recommended file name is body.html.
globalHTML5Api connects automatically, requested in the following way:
globalHTML5Api objects and methods should be defined inside a called function. All used modules should be listed as function parameters. The format can use the Video Player module and Shake module.
A simplified example of globalHTML5Api usage for the Shake format:
Key | Properties | Type | Description | |
---|---|---|---|---|
resize | – | Array | Array of objects | |
name (required) | String | Object name. Each object presents a particular container state (resizeState). | ||
fixed | – | Object with properties. Describes the container position relatively to a browser window | ||
vertical (required) | top, bottom | The vertical alignment of the container | ||
horizontal (required) | center | The horizontal alignment of the container | ||
width (required) | String|Number | Banner container width | ||
height (required) | String|Number | Banner container height |
Example of using the Shake format (click below to expand.
*In the example above, the callback function changes the banner’s color on the shake event.
Method | Arguments | Description |
---|---|---|
subscribe | Function | The method tracks the Shake event and launches a function after the event, that is when the user shook a device. |
Method | Arguments | Type | Description |
---|---|---|---|
click(URL) | – | – | Method to call the clickthrough. A clickthrough URL may be set in a creative’s code, as well as in 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 | Clickthrough URL | |
src(URL) | – | – | Method returns the absolute path to file |
URL (optional) | String | Relative path to file | |
globalHTML5Api.on(‘event’, callback);) | – | – | Function calling on an event |
event | String | Event ‘positionChange()’ | |
callback(positionData) | Function | callback function |
In case the creative contains video, see the Video player module page.
Supported file types: .jpg, .png, .gif, .svg.