Time for action – creating a basic carousel
Follow these steps to set up a basic jCarousel of images:
- As usual, we'll get started with our HTML. Set up a basic HTML document and associated files and folders just like we did in Chapter 1, Designer, Meet jQuery. In the body of the HTML document, create an unordered list of images. The carousel works best when the images are of uniform size. I've made my images 200 pixels wide by 150 pixels tall. Here's what my HTML looks like:
<ul id="thumb-carousel"> <li><img src="images/thumbs/Switzerland.png" alt="Switzerland"/></li> <li><img src="images/thumbs/CostaRica.png" alt="Costa Rica"/></li> <li><img src="images/thumbs/Canada.png" alt="Canada"/></li> <li><img src="images/thumbs/Seychelles.png" alt="Seychelles"/></li> ...
Get jQuery for Designers Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.