페이지 푸시
스크립트: https://koin-ad.click/page-push/v1/main.js
요소: <x-push>
전역 객체: push
공통 메서드는 광고 태그 API에 있습니다. 페이지 푸시는 show(options)와 특성 네 개를 더합니다.
설치
카드를 보여줄 때 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> 태그는 하나만 쓰세요. 이 파일을 두 번 불러오지 마세요.
요소를 직접 둘 수도 있습니다.
html
<x-push display-time="8000" position="bottom-left"></x-push>show(options)
모든 필드는 생략할 수 있습니다.
| 필드 | 특성 | 기본 | 의미 |
|---|---|---|---|
displayTime | display-time | 5000 | 카드가 스스로 닫히기까지 머무는 시간. 밀리초 |
animationTime | animation-time | 300 | 들어올 때와 나갈 때의 애니메이션. 밀리초 |
defaultClose | default-close | true | displayTime이 끝나면 닫음 |
position | position | bottom-right | 화면의 모서리 |
displayTime과 animationTime은 0 또는 양수여야 합니다. 그 밖의 값은 기본값을 씁니다.
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는 그 바깥 상자의 선택자입니다.