Class Carousel
ภาพหมุน
ภาพสไลด์หรือที่เรียกว่าแถบเลื่อนจะหมุนและแสดงรายการวิดเจ็ตในรูปแบบสไลด์โชว์ โดยมีปุ่มไปยังวิดเจ็ตก่อนหน้าหรือถัดไป
พร้อมใช้งานสำหรับส่วนเสริมของ Google Workspace และแอป Google Chat
const carousel =
CardService.newCarousel()
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The first text paragraph in carousel')))
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The second text paragraph in carousel')))
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The third text paragraph in carousel')))
เอกสารประกอบโดยละเอียด
addCarouselCard(card)
เพิ่มการ์ดภาพสไลด์
const carousel =
CardService.newCarousel()
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The first text paragraph in carousel')));
พารามิเตอร์
รีเทิร์น
Carousel
— ออบเจ็กต์นี้สําหรับการต่อเชื่อม
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-01-30 UTC
[null,null,["อัปเดตล่าสุด 2025-01-30 UTC"],[[["Carousel, also known as a slider, displays widgets in a rotating slideshow format with navigation buttons."],["Carousels are available for use in Google Workspace add-ons and Google Chat apps."],["The `addCarouselCard(card)` method is used to add a carousel card to the carousel, and it returns the Carousel object for chaining."],["Carousels are currently part of the Google Workspace Developer Preview Program, providing early access to this feature."]]],["Carousel, or slider, displays widgets in a slideshow format, navigable via buttons. It's available for Google Workspace add-ons and Google Chat apps. Developers use `CardService.newCarousel()` to create it. `addCarouselCard(card)` method adds individual cards, such as text paragraphs, to the carousel. Each card can be created using `CardService.newCarouselCard()`. This method returns the Carousel object, allowing for chaining of card additions. This is available in the Google Workspace Developer Preview Program.\n"]]