Projet

Général

Profil

Paste
Télécharger (11 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / libraries / flexslider-2.5.0 / README.mdown @ 0aee3c58

1
[![Gitter chat](https://badges.gitter.im/woothemes/FlexSlider.png)](https://gitter.im/woothemes/FlexSlider)
2

    
3
# FlexSlider 2.5.0
4
http://www.woothemes.com/flexslider/ - Copyright (c) 2015 WooThemes
5

    
6
## Releases
7

    
8
The `master` branch of this repository is always the latest development version of FlexSlider. Please view the [Releases](https://github.com/woothemes/FlexSlider/releases) section for a list of official FlexSlider builds.
9

    
10
### Contributing
11

    
12
We encourage contributions to FlexSlider and will review all pull requests submitted.
13

    
14
Before contributing, please see our [Contributing Guide](https://github.com/woothemes/FlexSlider/blob/master/CONTRIBUTING.md).
15

    
16
### Roadmap
17

    
18
To keep up to date with how FlexSlider's development roadmap looks, please see our [development roadmap](https://github.com/woothemes/FlexSlider/wiki/Roadmap).
19

    
20
## Updates
21

    
22
** Version 2.5.0 **
23

    
24
** Bumped compatibility support starting with jQuery 1.7+. pausePlay icon fix. Firefox touch event fix. Adds customDirectionNav param **
25

    
26
** Version 2.4.0 **
27

    
28
** Update for improved standards. Adds classes to li nav elements. Reset for li elements in stylesheet. **
29

    
30
** Version 2.3.0 **
31

    
32
** Fixes pauseInvisible attribute issue with Chrome and the Page Visibility API. **
33

    
34
** Version 2.2.2 **
35

    
36
** Fixes minified JavaScript file to remove merge conflicts. **
37

    
38
** Version 2.2.0 **
39

    
40
- Fixed event handler conflicts with devices that are both click and touch enabled. e.g., Windows 8.
41
- Made all slider variables public, stored in `slider.vars`. This allows manipulation of `slider.vars.minItems` and `slider.vars.maxItems` on the fly to create different fluid grids at certain breakpoints. [Check out this example demonstrating a basic technique](http://flexslider.woothemes.com/dynamic-carousel-min-max.html)
42
- Fixed calculations that were causing strange issues with paging and certain FlexSliders to move out of alignment.
43

    
44
*Be sure to test v2.2.0 with your current slider, before pushing live, to ensure everything is playing nicely.*
45

    
46
-----
47

    
48
## General Notes
49
FlexSlider is no longer licensed under the MIT license. FlexSlider now uses the license, GPLv2 and later.
50

    
51
In an effort to move the plugin forward, support for jQuery 1.4.2 has been dropped. The plugin now requires jQuery 1.7.0+. If you don't have access to the later versions of jQuery, [FlexSlider 1.8](https://github.com/woothemes/FlexSlider/tree/flexslider1) should be a perfectly suitable substitute for your needs!
52

    
53
Your old styles and properties *might not work out of the box*. Some property names have been changed, noted below, as well as namespacing prefixes being applied to all elements. This means that `.flex-direction-nav .next` is now `.flex-direction-nav .flex-next` by default. The namespacing property is exposed, free for you to change.
54

    
55
No more overflow hidden woes! The plugin now generates a viewport element to handle the tedious task of working around overflow hidden. Yay!
56

    
57
The slider element is now accessible outside of the callback API via the jQuery .data() method. Example use: `$('#slider').data('flexslider')`
58

    
59
Helper strings have been added for performing actions quickly on FlexSlider elements. Example uses:
60

    
61
- `$('#slider').flexslider("play")  //Play slideshow`
62
- `$('#slider').flexslider("pause") //Pause slideshow`
63
- `$('#slider').flexslider("stop") //Stop slideshow`
64
- `$('#slider').flexslider("next")  //Go to next slide`
65
- `$('#slider').flexslider("prev")  //Go to previous slide`
66
- `$('#slider').flexslider(3)       //Go fourth slide`
67

    
68
Two new methods are available for adding/removing slides, `slider.addSlide()` and `slider.removeSlide()`. More details about this coming soon.
69

    
70
- `slider.addSlide(obj, pos)` accepts two parameters, a string/jQuery object and an index.
71
- `slider.removeSlide(obj)` accepts one parameter, either an object to be removed, or an index.
72

    
73
## Examples
74

    
75
- [Basic Slider](http://flexslider.woothemes.com/)
76
- [Basic Slider customDirectionNav](http://flexslider.woothemes.com/basic-slider-with-custom-direction-nav.html)
77
- [Slider w/thumbnail controlNav pattern](http://flexslider.woothemes.com/thumbnail-controlnav.html)
78
- [Slider w/thumbnail slider](http://flexslider.woothemes.com/thumbnail-slider.html)
79
- [Basic Carousel](http://flexslider.woothemes.com/basic-carousel.html)
80
- [Carousel with min and max ranges](http://flexslider.woothemes.com/carousel-min-max.html)
81
- [Video with Vimeo API](http://flexslider.woothemes.com/video.html)
82
- [Video with Wistia API](http://flexslider.woothemes.com/video-wistia.html)
83

    
84

    
85
## Properties
86

    
87
### namespace: *{new}*
88
`namespace` controls the prefixes attached to elements created by the plugin. In previous releases, only certain elements were tagged with a prefix class, which was causing class generalization issues for some users. FlexSlider now prefixes all generated elements with the appropriate namespace.
89

    
90
*Hint: `namespace` can be an empty string.*
91

    
92
### selector: *{new}*
93
The markup structure for FlexSlider has been limited to a "ul.slide li" pattern in previous versions of FlexSlider; no longer. You can now take full control of the markup structure used for your FlexSlider. The `selector` pattern "{container} > {slide}" is mandatory, allowing the plugin to predictably interpret the selector property. Omitting the ">" from the selector is not suggested, but is possible if your markup doesn't follow the immediate descendant pattern.
94

    
95
*Examples: "section > article", ".slides > .slide", "#hero .slide"*
96

    
97
### easing: *{new}*
98
`easing` allows support for jQuery easing! Default options provided by jQuery are "swing" and "linear," but more can be used by included the jQuery Easing plugin. *If you chose a non-existent easing method, the slider will break.*
99

    
100
*Note: You need to set `useCSS: false` to force transitions in browsers that support translate3d.*
101
*Optional: [jQuery Easing Plugin](http://gsgd.co.uk/sandbox/jquery/easing/)*
102

    
103
### direction: *{changed}*
104
Previously called "slideDirection" in v1.8 and below.
105

    
106
### reverse: *{new}*
107
`reverse` will reverse the animation direction of the slider. Meaning, horizontal sliders can move from right to left, and vertical sliders can move bottom to top.
108

    
109
### smoothHeight: *{new}*
110
`smoothHeight` allows for smooth height transitions between slides. This property currently works for the fade and horizontal slide animation. The property has no effect on horizontal sliding carousels, however.
111

    
112
### startAt: *{changed}*
113
Previously called "slideToStart" in v1.8 and below.
114

    
115
### animationSpeed: *{changed}*
116
Previously called "animationDuration" in v1.8 and below.
117

    
118
### initDelay: *{new}*
119
`initDelay` will delay the initial slideshow of a slider, given in milliseconds. The slider will still initialize, generating controls and displaying the first image, but the slideshow will wait until the `initDelay` time has completed before starting the slideshow.
120

    
121
### useCSS: *{new}*
122
`useCSS` allow users to override using CSS3 for animation. Translate3d still has numerous bugs that can crop up and wreak havoc, so this is a great property to play with if you are experiencing unexplainable issues in Webkit browsers.
123

    
124
*Hint: Use conditionals to enable/disable the use of CSS3 on desktops and mobile devices. Mobile devices, in my experience, do not share many of the translate3d bugs seen on desktop browsers.*
125

    
126
### touch: *{new}*
127
`touch` allows users to exclude touch swipe functionality from their sliders.
128

    
129
### keyboard: *{changed}*
130
Previously called "keyboardNav" in v1.8 and below.
131

    
132
### multipleKeyboard *{new}*
133
`multipleKeyboard` allows users to override the default plugin keyboard behavior, enabling keyboard control of more than one slider on the page. This means that all visible sliders will animate, at the same time, via keyboard input.
134

    
135
*Hint: You can use `multipleKeyboard` to allow keyboard navigation on pages where multiple sliders are present, but only one is visible.*
136

    
137
### mousewheel: *{updated}*
138
`mousewheel` now requires the jQuery Mousewheel plugin. There are a few reasons for this, but primarily because there is no need for FlexSlider itself to reinvent the awkward complexity of mousewheel interactivity that is handled perfectly by the Mousewheel plugin.
139

    
140
*Required: [jQuery Mousewheel Plugin](https://github.com/brandonaaron/jquery-mousewheel)*
141

    
142
### controlsContainer: *{updated}*
143
`controlsContainer` is one of the more painstaking, potentially confusing properties within FlexSlider. First, the property is no longer required to workaround `overflow: hidden` on slide animation. Second, the property now accepts a **jQuery object**, giving you precise control over the object you want. The plugin no longer attempts to guess what element you are selecting.
144

    
145
### customDirectionNav: *{new}*
146
`customDirectionNav` allows the ability to add custom directional navigation elements. Can be used in conjunction with controlsContainer for pagination controls container.
147

    
148
*[Example of customDirectionNav being used](http://flexslider.woothemes.com/basic-slider-with-custom-direction-nav.html)*
149

    
150
### sync: *{new}*
151
`sync` is a new property that will allow other slider(s) to hook into the current slider via a given selector. The selector should describe an object that has already been initialized as a FlexSlider. Right now, `sync` will synchronize animation, play, and pause behaviors. More behaviors can be added in the future as the property matures.
152

    
153
*[Example of sync being used](http://flex.madebymufffin.com/examples/basic-carousel.html)*
154

    
155
### asNavFor: *{new}*
156
Description to be added.
157

    
158
### itemWidth: *{new}*
159
`itemWidth` is the primary property for the new carousel options. Without this property, your slider is not considered a carousel. To use `itemWidth`, give an integer value of the width of your individual slides. This should include borders and paddings applied to your slides; a total width measurement.
160

    
161
### itemMargin: *{new}*
162
`itemMargin` describes the gutter between the slide elements. If each slide has a margin-left of 10px, your itemMargin value would be 10. If elements have margin: 0 10px, your itemMargin would be 20.
163

    
164
### minItems: *{new}*
165
`minItems` describes the minimum number of slide elements that should be visible in the carousel. When the slider reaches the minimum item count, the slides will resize fluidly with the slider.
166

    
167
### maxItems: *{new}*
168
`maxItems` describes the maximum number of slide elements that should be visible in the carousel. When the slider reaches the maximum item count, the slides will resize fluidly with the sider.
169

    
170
### move: *{new}*
171
`move` determines how many slides should be animated within the carousel. When left at 0, the slider will animate the number of visible slides. If any value greater than 0 is given, the slider will animate that number of slides in the carousel on each animation interval.
172

    
173
*Hint: The move property will be ignored if the value is higher than the number of visible slides, which can be utilized in responsive design.*
174

    
175
### added: *{new}*
176
`added()` is a new callback event fired in the new slider.addSlide() function.
177

    
178
### removed: *{new}*
179
`removed()` is a new callback event fired in the new slider.removeSlide() function.
180

    
181
### allowOneSlide: *{new}*
182
Boolean. Whether or not you'd like FlexSlider to initialize as usual if only one slide is present.