With the responsive awakening in web design it becomes important to not only take care of the visual part of a website but also of the functionality. Elastislide is a responsive jQuery carousel that will adapt its size and its behavior in order to work on any screen size. Inserting the carousels structure into a container with a fluid width will also make the carousel fluid.
View demo Download source
With the responsive awakening in web design it becomes important to not only take care of the visual part of a website but also of the functionality. Elastislide is a responsive jQuery carousel that will adapt its size and its behavior in order to work on any screen size. Inserting the carousel’s structure into a container with a fluid width will also make the carousel fluid.
In a carousel, one could think that simply making its container “shorter” will solve the problem on smaller screens, but in some cases (e.g. when we have bigger images) it might be reasonable to resize the items as well. This and other options are part of Elastislide’s properties.
Elastislide uses the jQuery Touchwipe Plugin which allows you to obtain the wipe event on an iPhone, iPad or iPod Touch.
The images are by Karrie Nodalo and you can find her awesome photos here:Karrie Nodalo’s Photostream on FlickrHer images are licensed under the Attribution 2.0 Generic License.
The HTML Structure
The Markup for the carousel consists of a main wrapper that will adjust to the width of any fluid container you put it into. (If you put the carousel in a container with a fixed width, it will not adapt. So make sure that your container has a fluid layout.)The carousel element will have an unordered list with linked images:
1
2
3
4
5
6
7
8
9
10
11
12
13
...
...
Use your preferred ID and call the plugin like this:
1
2
3
$('#carousel').elastislide({
imageW : 180
});
where imageW is the width of the thumbnails.
Options
Elastislide has the following default options:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
speed : 450,
easing : '',
imageW : 190,
margin : 3,
border : 2,
minItems : 1,
current : 0,
onClick : function() { return false; }
It is also possible to dynamically add new items to the carousel. The following is an example on how to achieve that:
1
2
var $items = $(' ... Read more


