Skip to content

ページプッシュ ​

スクリプト: https://koin-ad.click/page-push/v1/main.js

要素: <x-push>

グローバルオブジェクト: push

共通のメソッドは 広告タグ API にあります。ページプッシュは show(options) と 4 つの属性を追加します。

インストール ​

カードを出したいときに show() を呼び出してください。要素を返します。スクリプトが要素名を登録していなければ、null を返します。

html
<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>

<script> タグは 1 つだけにしてください。このファイルを 2 回読み込まないでください。

要素を自分で置くこともできます。

html
<x-push display-time="8000" position="bottom-left"></x-push>

show(options) ​

どのフィールドも省略できます。

フィールド属性既定意味
displayTimedisplay-time5000カードが自ら閉じるまで表示する時間。ミリ秒
animationTimeanimation-time300入場と退場のアニメーション。ミリ秒
defaultClosedefault-closetruedisplayTime が終わったら閉じる
positionpositionbottom-right画面の隅

displayTime と animationTime は、ゼロまたは正の数でなければなりません。それ以外の値は既定値を使います。

default-close は true、false、1、0 を受け付けます。

position は top-left、top-right、bottom-left、bottom-right のいずれかです。それ以外の値は bottom-right になります。

js
const card = push.show({
  displayTime: 0,
  defaultClose: false,
  animationTime: 200,
  position: 'top-right',
});

displayTime: 0 または defaultClose: false にすると、訪問者が閉じるか、あなたが push.close() を呼ぶまで、カードは表示されたままです。

訪問者が閉じるときは、退場アニメーションを再生してから要素を外します。push.close() はすぐに外します。

theme() の名前 ​

名前選択対象
push<x-push> 要素
cardカード
cover画像
bodyテキストの領域
titleタイトル
subtitle説明
prompt行動を促す行
micro-label小さいラベル
badge-iconバッジ
svg-iconアイコン

カードは position: fixed で、幅は 380px、選んだ隅から 16px 内側です。push はその外側の箱のセレクタです。

トラフィックを通貨に。・Koin 広告ネットワークのユーザーガイド