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')));
المعلمات
الاسم | النوع | الوصف |
card | CarouselCard | بطاقة لوحة العرض الدوّارة المطلوب إضافتها. |
الإرجاع
Carousel
: هذا العنصر، لإنشاء سلسلة.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eCarousel, also known as a slider, displays widgets in a rotating slideshow format with navigation buttons.\u003c/p\u003e\n"],["\u003cp\u003eCarousels are available for use in Google Workspace add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddCarouselCard(card)\u003c/code\u003e method is used to add a carousel card to the carousel, and it returns the Carousel object for chaining.\u003c/p\u003e\n"],["\u003cp\u003eCarousels are currently part of the Google Workspace Developer Preview Program, providing early access to this feature.\u003c/p\u003e\n"]]],["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"],null,["# Class Carousel\n\nCarousel\n\nCarousel, also known as slider, rotates and displays a list of widgets in a slideshow format,\nwith buttons navigating to the previous or next widget.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst carousel =\n CardService.newCarousel()\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The first text paragraph in carousel')))\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The second text paragraph in carousel')))\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The third text paragraph in carousel')))\n```\n\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.\n\n\u003cbr /\u003e\n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------|---------------|-----------------------|\n| [addCarouselCard(card)](#addCarouselCard(CarouselCard)) | [Carousel](#) | Adds a carousel card. |\n\nDetailed documentation\n----------------------\n\n### `add``Carousel``Card(card)`\n\nAdds a carousel card.\n\n```javascript\nconst carousel =\n CardService.newCarousel()\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The first text paragraph in carousel')));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-------------------------------------------------------------------|---------------------------|\n| `card` | [CarouselCard](/apps-script/reference/card-service/carousel-card) | The carousel card to add. |\n\n#### Return\n\n\n[Carousel](#) --- This object, for chaining."]]