Skip to content

page push ​

สคริปต์: https://koin-ad.click/page-push/v1/main.js

องค์ประกอบ: <x-push>

อ็อบเจกต์ส่วนกลาง: push

เมธอดที่ใช้ร่วมกันอยู่ใน API แท็กโฆษณา page push เพิ่ม 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>

ใช้แท็กสคริปต์เดียว อย่าโหลดไฟล์สองครั้ง

คุณยังวางองค์ประกอบเองได้:

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

show(options) ​

ทุกฟิลด์เป็นทางเลือก

ฟิลด์แอตทริบิวต์ค่าเริ่มต้นความหมาย
displayTimedisplay-time5000การ์ดอยู่ได้นานเท่าใด เป็นมิลลิวินาที ก่อนปิดตัวเอง
animationTimeanimation-time300แอนิเมชันเข้าและออก เป็นมิลลิวินาที
defaultClosedefault-closetrueปิดเมื่อ displayTime จบ
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