O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a carousel for images

In this recipe, you'll learn to create a carousel. A carousel is a widget that allows the user to slide back and forth between different elements. In our recipe, these elements will be pictures. This method provides a simple and intuitive mechanism for displaying pictures, allowing users to skip between them with a simple touch gesture. Optionally, the carousel can be configured to work as an automatic slideshow.

You can use as many images as you want, but we're only going to work with three pictures for this recipe.

The complete code for this recipe, including the pictures, can be found at code/ch04/carousel/ in the code bundle provided on the Packtpub site.

Getting ready

Sencha Touch provides a predefined widget ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required