‹‹ cycle homejQuery Cycle Plugin - Beginner Demos

1 - Define Your Markup and Styles

All of the examples on this page use the following markup and CSS:

<div class="pics">
    <img src="images/beach1.jpg" width="200" height="200" />
    <img src="images/beach2.jpg" width="200" height="200" />
    <img src="images/beach3.jpg" width="200" height="200" />
.pics { 
    height:  232px; 
    width:   232px; 
    padding: 0; 
    margin:  0; 

.pics img { 
    padding: 15px; 
    border:  1px solid #ccc; 
    background-color: #eee; 
    width:  200px;
    height: 200px;
    top:  0;
    left: 0

2 - Choose an Effect

You can choose from any of the following named effects:

You specify the effect name by either passing a string to the cycle method or by using an options object and setting the fx property to the name of the desired effect.

    fx: 'scrollDown'

3 - Choose Speed and Timeout Values

Next you may want to choose speed and timeout values to control how fast and how often the slide transitions occur. The speed option defines the number of milliseconds it will take to transition from one slide to the next. The timeout option specifies how many milliseconds will elapse between the start of each transition.

    fx:    'fade',
    speed:  2500
    fx:      'scrollDown',
    speed:    300,
    timeout:  2000

4 - Choose Other Options

There are many other options to choose from. Two that you may find useful are pause and random. The pause option causes the slideshow to pause when the mouse hovers over the slide. The random option causes the slides to be shown in random order, rather than sequential.

    fx:    'fade',
    pause:  1
    fx:     'scrollDown',
    random:  1

Things to Keep in Mind

- CSS Rules! When building your slideshows, remember that animation effects work best when both the container and slide have a fixed box.

- Remember that every child element of the container becomes a slide!

Next up: Intermediate Demo (Part 1) ››