With jQuery for Designer’s redesign I decided to add a scrolling carousel that worked in the same way the carousel worked on the Apple Mac ads page.
This tutorial will walk through the fundamentals of the effect and how to recreate it.
This is a reasonably advanced effect so we need to plan carefully what we’re trying to achieve:
This tutorial will walk through the fundamentals of the effect and how to recreate it.
This is a reasonably advanced effect so we need to plan carefully what we’re trying to achieve:
- Markup that works without JavaScript (done!)
- Initialisation & capture the height and width of the first carousel item (required for calculations)
- Create empty list items to pad to fill every page
- Generate cloned items on the start and end of the list
- Adjust the scroll left position to show the real first item
- Create goto method that supports forward and backwards
- Generate the next/prev links & bind goto calls
No comments:
Post a Comment