Page push
Script: https://koin-ad.click/page-push/v1/main.js
Element: <x-push>
Global object: push
Shared methods are in the Ad tag API. Page push adds show(options) and four attributes.
Install
Call show() when you want the card. It returns the element, or null if the script did not register the element name.
<script>
function onKoinPush() {
push.show({
displayTime: 8000,
position: 'bottom-left',
});
}
</script>
<script
async
src="https://koin-ad.click/page-push/v1/main.js?id=UNIT_ID"
onload="onKoinPush()"
></script>Use one script tag. Do not load the file twice.
You can also place the element yourself:
<x-push display-time="8000" position="bottom-left"></x-push>show(options)
Every field is optional.
| Field | Attribute | Default | Meaning |
|---|---|---|---|
displayTime | display-time | 5000 | How long the card stays, in milliseconds, before it closes itself |
animationTime | animation-time | 300 | Enter and leave animation, in milliseconds |
defaultClose | default-close | true | Close when displayTime ends |
position | position | bottom-right | Corner on the screen |
displayTime and animationTime must be zero or a positive number. Anything else uses the default.
default-close accepts true, false, 1 and 0.
position is one of top-left, top-right, bottom-left, bottom-right. Any other value becomes bottom-right.
const card = push.show({
displayTime: 0,
defaultClose: false,
animationTime: 200,
position: 'top-right',
});displayTime: 0 or defaultClose: false leaves the card up until the visitor closes it, or until you call push.close().
The visitor's close plays the leave animation, then removes the element. push.close() removes it immediately.
theme() names
| Name | Selects |
|---|---|
push | The <x-push> element |
card | The card |
cover | The image |
body | The text block |
title | The title |
subtitle | The description |
prompt | The action line |
micro-label | The small label |
badge-icon | The badge |
svg-icon | The icon |
The card is position: fixed, 380px wide, and inset 16px from the chosen corner. push is the selector for that outer box.