Project Info:
A lightweight library allowing to easily integrate a carousel to a PHP project. It uses javascript without framework.
The creation of a carousel is simplified by the signature of the object.
The options of the carousel are the following:
slidesVisible
: how many slides are visible inside the carousel viewport?slidesToScroll
: how many slides should be scrolled when the user clicks on left or right arrows?infiniteScroll
: should we go back to slide 1 when the last slide has been reached?
Here is how to create a new carousel:
require 'src/Carousel.php';
$carousel = new Carousel(
[
new Slide(
'Slide content 1',
'Slide title 1',
'image1.jpg',
'http://www.link1.com'
),
new Slide(
'Slide content 2',
'Slide title 2',
'image2.jpg',
'http://www.link2.com'
)
], [
'slidesVisible' => 2,
'slidesToScroll' => 1,
'infiniteScroll' => 1
]
);
$carousel->show();