grid-to-carousel
A jQuery plugin for transitioning between a Bootstrap grid and carousel.
Demo
https://nicholaswright.github.io/grid-to-carousel/
How does it work?
- Clicking a grid item creates a clone directly on top of it.
- The clone then expands to cover the grid.
- The clone is then removed, the grid hidden and the carousel displayed.
- The carousel's 'active' class is assigned to the slide and indicator with the same index as the grid element so that the correct slide is displayed.
- On closing the carousel the close button's index is used to determine the grid item to be targeted.
- The grid item is cloned, exanded to cover the grid, the carousel hidden and the grid displayed.
- The clone is then shrunk down to the size and location of the grid item before being removed.