Hi
This lesson is about the 3 layout elements being the carousel, multiview and the tabview. Each of the elements here are added in each row of our page.
Carousel: We will create a carousel with three sliders. We will use css to set the background and color of each slide.
Each slide in the carousel is added to the columns collection in the carousel. Whilst we can use .AddColumns, there is also an additional methid called .AddSlide added to easily add each slide.
To set the css element of each slide object, we have used the SetStyle method to change the background color and color of the slide. As the underlying elements are HTML elements, one can use any css combination they way for any WixElement.
After all the slides are added, we add the carousel to the rows of the page.
This lesson is about the 3 layout elements being the carousel, multiview and the tabview. Each of the elements here are added in each row of our page.
Carousel: We will create a carousel with three sliders. We will use css to set the background and color of each slide.
B4X:
Dim c As WixCarousel
c.Initialize("")
'create slides
Dim sld1 As WixElement
sld1.Initialize("")
sld1.SetTemplate("Gilligan")
sld1.SetStyle("background-color", "#ff0000")
sld1.SetStyle("color", "#ffff00")
sld1.AddToColumns(c.Carousel)
'
Dim sld2 As WixElement
sld2.Initialize("")
sld2.SetTemplate("Professor")
sld2.SetStyle("background-color", "#00ff00")
sld2.SetStyle("color", "#000000")
c.AddSlide(sld2)
'
Dim sld3 As WixElement
sld3.Initialize("")
sld3.SetTemplate("Mary Ann")
sld3.SetStyle("background-color", "#0000ff")
sld3.SetStyle("color", "#ffffff")
c.AddSlide(sld3)
pg.Page.AddRows(c.Item)
Each slide in the carousel is added to the columns collection in the carousel. Whilst we can use .AddColumns, there is also an additional methid called .AddSlide added to easily add each slide.
To set the css element of each slide object, we have used the SetStyle method to change the background color and color of the slide. As the underlying elements are HTML elements, one can use any css combination they way for any WixElement.
After all the slides are added, we add the carousel to the rows of the page.