原生
指令碼:https://koin-ad.click/native/v1/main.js
元素:<x-native>
全域物件:native
共用方法見 廣告代碼 API。原生另外提供 type 屬性。type 決定版面。它不跟著容器的尺寸走。
安裝
給元素一個盒子。廣告會填滿這個盒子。
html
<div style="width: 360px; height: 120px">
<script
async
src="https://koin-ad.click/native/v1/main.js?id=UNIT_ID"
></script>
<x-native type="detail"></x-native>
</div>type
若 type 缺少,或不在這份清單裡,版面是 compact。
type | 版面 | 索取的素材 |
|---|---|---|
compact | 短列,圖示在標題旁邊 | 64×64 |
detail | 較大的圖示,加上一段說明 | 120×120 |
card | 圖片橫跨頂部 | 430×242 |
html
<x-native type="card"></x-native>theme() 名稱
| 名稱 | 選取對象 |
|---|---|
native | <x-native> 元素 |
card | 整張卡片 |
cover | 圖片 |
body | 文字區塊 |
headline | 標題列 |
brand | 品牌行 |
title | 標題 |
subtitle | 說明 |
action | 動作 |
tools | 工具列 |
tool | 單一工具 |
js
native.theme(`
card {
background: #111;
}
title {
color: white;
}
`);