The amp-carousel is same like other components like owl-carousel, bootstrap-carousel etc., which allow to display content along with slider pieces.
To implement carousel in amp web page we need to import carousel component in the amp webpage header i.e.,
Basic line of code to create simple amp-carousel:
Attributes we can use in AMP-carousel:
1. TYPE
We can use two different types of attribute to show carousel in different way:
2. HEIGHT (required)
Ex 2: <amp-carousel height="550" >
3. CONTROL (optional)
4. AUTOPLAY (optional)
5. LOOP (optional)
Buttons/Controllers
By default,.amp-carousel-button utilises an inlined SVG as the buttons' background image.
.amp-carousel-button-prev { left: 16px; background-image: url('data:image/svg+xml;charset=utf-8,'); } .amp-carousel-button-next { right: 16px; background-image: url('data:image/svg+xml;charset=utf-8,'); }
How to maintain more than one item in a single slide?
Although amp-carousel always avail only a single item/image in a single slide at a time but using some basic generic HTML trick you can maintain more than 1 item/image at a time in a single slide
For EX:
You can put different items/images in a single <div> tag
By using this simple trick you can maintain more than one item in a single slide for amp-carousel easily.
--------------------------------------------------------------------------------------------------------------------------------------------------