底层弹窗
脚本:https://koin-ad.click/pop-under/v1/main.js
元素:<x-popunder>
全局对象:popunder
公共方法在 广告代码 API。底层弹窗额外有 show(),它自己没有素材。
接入
show() 在页面上创建一层透明遮罩,并返回该元素。如果脚本没有注册元素名,则返回 null。
html
<script>
function onKoinPop() {
popunder.show();
}
</script>
<script
async
src="https://koin-ad.click/pop-under/v1/main.js?id=UNIT_ID"
onload="onKoinPop()"
></script>也可以自己放元素。它仍然会盖住视口。
html
<script
async
src="https://koin-ad.click/pop-under/v1/main.js?id=UNIT_ID"
></script>
<x-popunder></x-popunder>show()
js
const layer = popunder.show();这一层相对视口固定、透明、可点击。它不渲染图片或标题。点击后跳到匹配到的广告,然后移除这一层。
没有广告返回时,元素会被移除。
theme() 的名字
| 名字 | 选中 |
|---|---|
pop-under | <x-popunder> 元素 |
js
popunder.theme(`
pop-under {
background: rgb(0 0 0 / 1%);
}
`);没有内部零件。遮罩要保持足够透明,让下面的页面仍然看得见。