The Basics

Default Settings

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

This is the ImgWheel plugin in it's most basic implementation. Scrolling is controlled by hovering over either side of the image display. The width of the display is set to 100% by default. The display and image sizes are responsive. If images included in the .image-container div are enclosed in an anchor tag, that link will only be active when an image is in the central position.

Example JavaScript

$('#my-slideshow').ImgWheel();

Setting the Display Size

Proportional, responsive width

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

Fixed width

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

When relative widths are used to size an ImgWheel container (i.e. width specified as a percent) the size of the images will change responsively when the browser window is resized. If a fixed width is used, this responsiveness is lost. The first container's displayWidth setting is set to '50%', while the second container's displayWidth is set to '400px'. Resize your browser window to see the difference.

Example JavaScript

$('#my-slideshow_1').ImgWheel({displayWidth: '50%'});
$('#my-slideshow_2').ImgWheel({displayWidth: '400px'});

Scroll Animation Speed Settings

One speed and one delay, regardless of cursor position

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

One speed, variable delay

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

Variable speed, variable delay

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

Four properties combine to control the speed of the scrolling animation. The animation speed settings (animateSpeedMax and animateSpeedMin) set how fast an image will transition from one position to the next. This is the time that the images are 'in motion'. The reason there are two settings, a max and a min, is that the speed will change based on the user's mouse position. When the user mouses toward the outside of the display, the speed throttles up toward the maximum setting; when the mouse moves in toward the middle of the display, the speed decreases toward the minimum setting. You are setting the range of possible animation speeds when you specify these two properties. That being said, if you don't want the animation to vary speed depending on cursor position, set the maximum and minimum equal to each other (as shown in the first example to the right).

The animation delay settings (delayMax and delayMin) control the total time it takes for one cycle of the transition animation to take place. The delay time encompasses the animation time, so in order for ImgWheel to work the specified delays must be equal to or greater than the specified animation times. Time for the minimum delay in excess of the animateSpeedMin setting will equal the time that an image pauses before moving onto the next position in the animation. Same with the maximum delay and the animateSpeedMax setting. In other words, if you set animateSpeedMin equal to delayMin, the images will not pause in a given location before moving on to the next location when the animation is moving at its slowest speed (when the user's cursor is near to the center of the display).

Confused yet? This is getting to be like trying to fly a toy helicopter! Don't worry, this is the only semi-complicated thing about ImgWheel. Take a look at the examples on the right and the sample JavaScript corresponding to each below

Example JavaScript

$('#my-slideshow_1').ImgWheel({animateSpeedMax: 1000, animateSpeedMin: 1000, delayMax: 1400, delayMin: 1400});

$('my-slideshow_2').ImgWheel({animateSpeedMax: 400, animateSpeedMin: 400, delayMax: 500, delayMin: 1750});

$('#my-slideshow_3').ImgWheel({animateSpeedMax: 200, animateSpeedMin: 3000, delayMax: 1000, delayMin: 3000});

Vertical Alignment of Images

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

The images in the scroll are vertically centered by default. This can be changed with the imgPlacement setting. Alternative options are 'top' or 'bottom'.

Example JavaScript

$('my-slideshow').ImgWheel({imgPlacement: 'bottom'});

Direction of Scrolling

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

When hovering on the left side of the display, the images will scroll to the right by default. This direction can be changed by setting direction to 'reverse'.

Example JavaScript

$('my-slideshow').ImgWheel({direction: 'reverse'});

Changing the Animation Trigger

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

There are two options for triggering the scrolling. The default is hovering on either side of the container (or touching either side of the container if touch is enabled on the user's device). The trigger can be changed to clicking by setting functionality to 'click'. When this setting is changed, hovering over the display shows directional arrows to either side. Clicking an arrow will cause the scroll to occur in the direction indicated. Again, the direction of this scroll is controlled with direction.

Example JavaScript

$('my-slideshow').ImgWheel({functionality: 'click'});

Apply Some Style

Blue Sun Cave Route Fracture On the Lamb Matthes Crest Third Pillar Scarface Traveler Buttress

The images in the scrolling display can be styled with CSS just as you would any other image. But what if you want your central image to display differently from other images in the container? This can be controlled by styling the .everythingBut and .onlyCentral classes in your CSS file. As the names imply, the .everythingBut class is applied to any image in the scroll that is not currently the central image. The .onlyCentral class is applied only to the central image in the display. For instance, here the .everythingBut class is styled to have reduced opacity and the grayscale filter applied. The .onlyCentral class is styled to include a 1px, black border. If you want to include different styling for these classes for multiple instances of ImgWheel on one page, use the appropriate CSS selection techniques.

Example JavaScript

$('my-slideshow').ImgWheel();

Example CSS

.onlyCentral {
  border: 1px solid black;
}
.everythingBut {
  opacity: .6;
  filter: grayscale(80%);
}