Carousel()

Creates a touch-enabled image carousel with 3D perspective effect. Supports both standard carousel and full-width slider modes.

Syntax
Result = MaterialSB::Carousel(Flags = #Carousel_Default, Parent = #Null)
Parameters
Flags Optional. Carousel style flags.
Parent Optional. Parent element. If #Null, uses the current parent from the stack.
Flags
FlagDescription
#Carousel_DefaultStandard 3D carousel with perspective (default)
#Carousel_SliderFull-width slider mode
Return Value

Returns the carousel element. Use this reference for Init() and CarouselAddItem().

Remarks

Important: Carousel requires Init() to be called after adding all items.

Use CarouselAddItem() to add images to the carousel. Each item can have an associated link.

Example
Procedure Main(Success)
  If Success
    MaterialSB::Row(MaterialSB::#Grid_Container)
      MaterialSB::Col(12)
        MaterialSB::Append(MaterialSB::Header("Image Gallery", 3))
        
        ; Create carousel
        myCarousel = MaterialSB::Carousel()
        
        ; Add carousel items
        MaterialSB::CarouselAddItem(myCarousel, "images/photo1.jpg", "#photo1")
        MaterialSB::CarouselAddItem(myCarousel, "images/photo2.jpg", "#photo2")
        MaterialSB::CarouselAddItem(myCarousel, "images/photo3.jpg", "#photo3")
        MaterialSB::CarouselAddItem(myCarousel, "images/photo4.jpg", "#photo4")
        MaterialSB::CarouselAddItem(myCarousel, "images/photo5.jpg", "#photo5")
        
        ; Initialize carousel
        MaterialSB::Init(myCarousel, #Null)
        
      MaterialSB::CloseCurrentParent()
    MaterialSB::CloseCurrentParent()
    
    ; Full-width slider example
    MaterialSB::Row(MaterialSB::#Grid_Container)
      MaterialSB::Col(12)
        MaterialSB::Append(MaterialSB::Header("Featured Slider", 3))
        
        ; Create slider carousel
        mySlider = MaterialSB::Carousel(MaterialSB::#Carousel_Slider)
        
        MaterialSB::CarouselAddItem(mySlider, "images/slide1.jpg", "#")
        MaterialSB::CarouselAddItem(mySlider, "images/slide2.jpg", "#")
        MaterialSB::CarouselAddItem(mySlider, "images/slide3.jpg", "#")
        
        ; Initialize slider
        MaterialSB::Init(mySlider, #Null)
        
      MaterialSB::CloseCurrentParent()
    MaterialSB::CloseCurrentParent()
  EndIf
EndProcedure

MaterialSB::Download(@Main())
See Also

CarouselAddItem(), Init()