An awesome, fully responsive jQuery slider plugin

Related tags

Sliders FlexSlider
Overview

Gitter chat

FlexSlider 2.7.2

http://www.woocommerce.com/flexslider/ - Copyright (c) 2015 WooThemes

Releases

The master branch of this repository is always the latest development version of FlexSlider. Please view the Releases section for a list of official FlexSlider builds.

Contributing

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

Before contributing, please see our Contributing Guide.

Roadmap

To keep up to date with how FlexSlider's development roadmap looks, please see our development roadmap.

Updates

** Version 2.7.2 **

** Refactor jQuery HTML output for img attributes.

** Version 2.7.1 **

** RTL fixes for Firefox browser.

** Version 2.7.0 **

** Fixes resize method call for orientationchange. Adds RTL feature - param "rtl" added. **

** Version 2.6.3 **

** Rollback fade fixes, due to harsh fade reports. **

** Version 2.6.2 **

** Minor update to fix issues with varying heights and overflow onto content below the slider. Fixes the visibility of the pagination and the navigation in the "fade" mode. **

** Version 2.6.1 **

** SmoothHeight now uses innerHeight() instead of height() to account for padding in calculation. Defining var altText to prevent error. bower.json add fonts folder on main field. Changed true to false in order to make sure whether or not to allow a slider comprised of a single slide. **

** Version 2.6.0 **

** Adds composer json file, scope fix for focused keyword, fixes bower demo folder exclusion, z-index fix for disabled nav arrow, play/pause accessibility fix, itemMargin fix for slider items, fixes accessibility for in focus elements and pagination controls, firefox fix for text selection on slider carousel, adds data-thumb-alt image alt attribute. **

** Version 2.5.0 **

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

** Version 2.4.0 **

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

** Version 2.3.0 **

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

** Version 2.2.2 **

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

** Version 2.2.0 **

  • Fixed event handler conflicts with devices that are both click and touch enabled. e.g., Windows 8.
  • 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
  • Fixed calculations that were causing strange issues with paging and certain FlexSliders to move out of alignment.

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


General Notes

FlexSlider is no longer licensed under the MIT license. FlexSlider now uses the license, GPLv2 and later.

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 should be a perfectly suitable substitute for your needs!

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.

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

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

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

  • $('#slider').flexslider("play") //Play slideshow
  • $('#slider').flexslider("pause") //Pause slideshow
  • $('#slider').flexslider("stop") //Stop slideshow
  • $('#slider').flexslider("next") //Go to next slide
  • $('#slider').flexslider("prev") //Go to previous slide
  • $('#slider').flexslider(3) //Go fourth slide

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

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

Examples

RTL Examples

Properties

namespace: {new}

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.

Hint: namespace can be an empty string.

selector: {new}

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.

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

easing: {new}

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.

Note: You need to set useCSS: false to force transitions in browsers that support translate3d. Optional: jQuery Easing Plugin

direction: {changed}

Previously called "slideDirection" in v1.8 and below.

reverse: {new}

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.

smoothHeight: {new}

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.

startAt: {changed}

Previously called "slideToStart" in v1.8 and below.

animationSpeed: {changed}

Previously called "animationDuration" in v1.8 and below.

initDelay: {new}

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.

useCSS: {new}

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.

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.

touch: {new}

touch allows users to exclude touch swipe functionality from their sliders.

keyboard: {changed}

Previously called "keyboardNav" in v1.8 and below.

multipleKeyboard {new}

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.

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

mousewheel: {updated}

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.

Required: jQuery Mousewheel Plugin

controlsContainer: {updated}

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.

customDirectionNav: {new}

customDirectionNav allows the ability to add custom directional navigation elements. Can be used in conjunction with controlsContainer for pagination controls container.

Example of customDirectionNav being used

sync: {new}

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.

Example of sync being used

asNavFor: {new}

Description to be added.

itemWidth: {new}

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.

itemMargin: {new}

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.

minItems: {new}

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.

maxItems: {new}

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.

move: {new}

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.

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.

added: {new}

added() is a new callback event fired in the new slider.addSlide() function.

removed: {new}

removed() is a new callback event fired in the new slider.removeSlide() function.

allowOneSlide: {new}

Boolean. Whether or not you'd like FlexSlider to initialize as usual if only one slide is present.

rtl: {new}

Boolean. False by default. Supports RTL functionality in the slider. Note: you must add style="direction:rtl" to your container div in order for this to work.

isFirefox: {new}

Boolean. False by default. Set to true if the Firefox browser is in use. Note: used for RTL compatibility logic.

Comments
  • Carousel with variable width of the items

    Carousel with variable width of the items

    Is there a way to make the carousel with variable width of the items?

    $('.flexslider').flexslider({
        animation: "slide",
        directionNav: true,
        animationLoop: false,
        itemWidth: 'variable', // this is the suggested syntax
        itemMargin: 5,
        move: 1
    });
    
    Feature Request 
    opened by ghost 117
  • FlexSlider navigation issue in Chrome 22 [Win 7]

    FlexSlider navigation issue in Chrome 22 [Win 7]

    Hi guys, does anybody noticed Flex slider not working properly in new Google Chrome 22?

    Just reporting: navigation elements are not working. Completely. They are being displayed but nothing happens when clicked. CSS hovers styles works fine on those.

    I have noticed some other (not Flex slider related) CSS errors with Chrome 22 so it might be some bug inside the browser, not your code as the slider works fine in other browsers. As I said, just reporting.

    Major Bug 
    opened by webmandesign 98
  • IE10 Touch doesn't work

    IE10 Touch doesn't work

    Hey, so just testing out flexslider on a Win8 slate PC here, and noticing that touch isn't behaving as expected in IE. Any chance of implementing the Microsoft touch API?

    edit: here is some info on the touch API in IE10 http://blogs.msdn.com/b/ie/archive/2011/09/20/touch-input-for-ie10-and-metro-style-apps.aspx || http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx

    I will be happy to be a tester if someone can try this out.

    Minor Bug 
    opened by alirobe 69
  • Touch gesturing causes slider to freeze on IOS 6

    Touch gesturing causes slider to freeze on IOS 6

    There is a problem with touch gesturing on IOS 6. It seems to effect the scroll-down gesture specifically. It causes the slideshow to freeze. You can’t scroll the page or slide to next/prev slides, either through gesturing or the control buttons.

    Tested on Iphone4, IOS6. Still works fine in IOS5.

    Example: the issue occurs on this demo: http://demo2.woothemes.com/?name=whitelight

    I was able to temporarily fix the freezing problem by switching to Flexslide 1.8 and commenting out the section with touch gesturing. An OK stop-gap as the touch gesturing is just a nice-to-have for my site.

    I tested the flexslide homepage demo and it doesn't seem to be a problem. So maybe it has something to do with full-width slides and gesturing.

    Thanks for any ideas.

    opened by mksweet 68
  • Infinite / Circular Loop

    Infinite / Circular Loop

    Hi Tyler - quick question (maybe needs to be explored offline) What would it take to get the infinite / circular loop functionality implemented? Or at the very least a hacky add-on?

    Feature Request 
    opened by jconroy 54
  • Calling .flexslider() when target is hidden.

    Calling .flexslider() when target is hidden.

    Flexslider 2 is a godsend.

    I have my slider behind a tab while using Twitter bootstrap, and when I switch to that tab, the slider doesn't function as expected. Is there any way of making sure that this conflict doesn't occur?

    opened by davekiss 52
  • How to Stop the Flexsilder when the Youtube Video is Playing.

    How to Stop the Flexsilder when the Youtube Video is Playing.

    I cant find any information on this one. This is my site. http://spyking.org

    After the video is played on the main page the Slider still moves and Slides, How do i fix this?

    opened by keneater 47
  • Firefox 26.0 onTouchStart vs ontouchstart

    Firefox 26.0 onTouchStart vs ontouchstart

    Flexslider 2.2.0 After update of FF to Version 26.0 my FlexSlider doesn't work correctly. I get error "ReferenceError: onTouchStart is not defined jquery.flexslider.js:397" with settings animation: "slide", touch: true

    When starting with a half sized browser window and 2 images the first image is scaled down. Everything seems to be OK. But when I enlarge the window to full size I see more than 2 images side by side and they don't react responsive. The clones aren't hidden.

    Setting touch:false: works.

    With touch:true I changed line 397 of jquery.flexslider.js from

    el.addEventListener('touchstart', onTouchStart, false);

    to (see lower case):

    el.addEventListener('touchstart', ontouchstart, false);

    The above mentioned error is gone and after some quick tests it looks like this fix works on FIREFOX (no further testing with other browsers!!).

    opened by ghost 42
  • Navigation not Working on Windows 8 !! != IE10,Fiefox&Chrome

    Navigation not Working on Windows 8 !! != IE10,Fiefox&Chrome

    Hello, just tried out the Flexslider on the new Windows 8 OS. The Navigation Buttons are not working, nether on ie10, firefox or chrome which is strange. no error in firebug. the carousel is working fine, so basically the slider works, only the navigation buttons don't. Any fixes yet ??

    Minor Bug 
    opened by ppoh71 35
  • FlexSlider not showing on IE9

    FlexSlider not showing on IE9

    Having an issue with FlexSlider not displaying. Random. Can't figure it out. It works on most machines I've tested. Windows 7, IE 9. Can you take a look?

    http://bit.ly/Y9Tbw

    Support Request 
    opened by plainspace 34
  • IOS7 css transitions

    IOS7 css transitions

    All my sites that use FlexSlider on iOS7 (Chrome and Safari) seem to have issues when you swipe on the '.flexslider' container. When you for example swipe down (on your container), hold it and then move left or right it moves your slide and after that it just seems to lock up.

    It seems to be an issue with CSS transitions in iOS7, 'useCSS': false, seems to fix it.

    opened by thaoms 32
  • thumbCaptions setting creates invalid html

    thumbCaptions setting creates invalid html

    There is a thumbCaptions setting that, if set to true, looks for a data-thumbcaption attribute on the slides and uses that to add a caption to each thumbnail. This only activates if controlNav is set to "thumbnails". When it adds the caption, it appends a span to the img elements that are the thumbnails. Img elements can't contain other elements, so the captions never display.

    opened by mattdyer 0
  • Cannot read properties of undefined (reading 'toLowerCase'

    Cannot read properties of undefined (reading 'toLowerCase'

    Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase') at Object.init (jquery.flexslider-min.js:5:1522) at new $.flexslider (jquery.flexslider-min.js:5:21487) at HTMLDivElement.<anonymous> (jquery.flexslider-min.js:5:22661) at Function.each (jquery-3.6.1.min.js:2:3003) at S.fn.init.each (jquery-3.6.1.min.js:2:1481) at $.fn.flexslider (jquery.flexslider-min.js:5:22464) at home:93:26 at dispatch (jquery-3.6.1.min.js:2:43064) at y.handle (jquery-3.6.1.min.js:2:41048) init @ jquery.flexslider-min.js:5 $.flexslider @ jquery.flexslider-min.js:5 (anonymous) @ jquery.flexslider-min.js:5 each @ jquery-3.6.1.min.js:2 each @ jquery-3.6.1.min.js:2 $.fn.flexslider @ jquery.flexslider-min.js:5 (anonymous) @ home:93 dispatch @ jquery-3.6.1.min.js:2 y.handle @ jquery-3.6.1.min.js:2 load (async) add @ jquery-3.6.1.min.js:2 (anonymous) @ jquery-3.6.1.min.js:2 each @ jquery-3.6.1.min.js:2 each @ jquery-3.6.1.min.js:2 Ee @ jquery-3.6.1.min.js:2 on @ jquery-3.6.1.min.js:2 (anonymous) @ home:92

    opened by quinhone 0
  • slide container gets bigger when another slide has a tall vertical or horizontal image

    slide container gets bigger when another slide has a tall vertical or horizontal image

    I explain in more detail what happens to me,

    I have a container where the basic example code is at the url http://flexslider.woothemes.com/

    then it happens that when there are images of different heights, the slide that is active or displayed to the user, the container is enlarged

    opened by havasjeancarlostrabajo 0
  • does not start on the first slider

    does not start on the first slider

    a cordial greeting and first of all thank you for the wonderful plugin, I am using it to animate a website where the content of the slider is loaded from ajax, the problem that I present is that the slider, instead of initializing in the first slide, starts in the position 0 I share my settings

    $('#slider').flexslider({
                        keyboard: false,
                        directionNav: true,
                        animation: "slide",
                        randomize: false,
                        reverse: false,
                        controlNav: false,
                        slideshowSpeed: 6000,
                        startAt: 0,
                        initDelay: 300,
                        prevText: "",
                        nextText: "",
    })
    
    opened by havasjeancarlostrabajo 1
  • FlexSlider prevents use of back/forward cache

    FlexSlider prevents use of back/forward cache

    https://web.dev/bfcache/#test-to-ensure-your-pages-are-cacheable

    When running on a page with FlexSlider 2.6.3, I get the result Pages that use SpeechSynthesis are not currently eligible for back/forward cache.

    Adding a property breakpoint reveals it's this function:

    ya=function(){if("undefined"==typeof a)return!1;for(var b in a)try{!xa["$"+b]&&O(a,b)&&null!==a[b]&&"object"==typeof a[b]&&wa(a[b])}catch(c){return!0}return!1}()
    

    Adjusting to the following makes Chrome report the page is back/forward cacheable:

    ya=function(){if("undefined"==typeof a)return!1;for(var b in a)try{if(b=="speechSynthesis"){return !0}!xa["$"+b]&&O(a,b)&&null!==a[b]&&"object"==typeof a[b]&&wa(a[b])}catch(c){return!0}return!1}()
    
    opened by JasonBarnabe 0
Releases(2.7.2)
Swiffy-slider - Super fast carousel and slider with touch for optimized websites running in modern browsers.

Swiffy Slider Super fast lightweight carousel and slider with touch for optimized websites running in modern browsers. Explore Swiffy Slider docs » Se

Dynamicweb Software A/S 149 Dec 28, 2022
noUiSlider is a lightweight JavaScript range slider library with full multi-touch support. It fits wonderfully in responsive designs and has no dependencies.

noUiSlider noUiSlider is a lightweight JavaScript range slider. No dependencies All modern browsers and IE > 9 are supported Fully responsive Multi-to

Léon Gersen 5.4k Dec 28, 2022
A jQuery plugin for a slider with adaptive colored figcaption and navigation.

Adaptive Slider jQuery Plugin A jQuery plugin for a slider with adaptive colored figcaption and navigation. This plugin will take a list of figure ele

null 53 Jan 3, 2023
jQuery only range slider

Ion.RangeSlider. Is an easy, flexible and responsive range slider with tons of options. Version: 2.3.1 | Version 3.x is under development now Project

Denis Ineshin 2.5k Dec 25, 2022
A jquery UI range selection slider that supports dates

jQRangeSlider, jQDateRangeSlider & jQEditRangeSlider A javascript slider selector that supports dates and touch devices Home page Documentation Suppor

Guillaume Gautreau 676 Sep 24, 2022
🎚 HTML5 input range slider element polyfill

rangeslider.js Simple, small and fast jQuery polyfill for the HTML5 <input type="range"> slider element. Check out the examples. Touchscreen friendly

André Ruffert 2.2k Jan 8, 2023
Most modern mobile touch slider with hardware accelerated transitions

Get Started | Documentation | Demos Swiper Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing

Vladimir Kharlampidi 33.7k Jan 9, 2023
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

Glide.js is a dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more What can co

null 6.7k Jan 7, 2023
OlumSlider is a lightweight and flexible slider, written via vanilla js

olum-slider OlumSlider is a lightweight and flexible slider, written via vanilla js Documentation CDN <!DOCTYPE html> <html lang="en"> <head> <t

Olumjs 0 Oct 8, 2021
The responsive CSS animation framework for creating unique sliders, presentations, banners, and other step-based applications.

Sequence.js The responsive CSS animation framework for creating unique sliders, presentations, banners, and other step-based applications. Sequence.js

Ian Lunn 3.4k Dec 20, 2022
:leaves: Touch, responsive, flickable carousels

Flickity Touch, responsive, flickable carousels See flickity.metafizzy.co for complete docs and demos. Install Download CSS: flickity.min.css minified

Metafizzy 7.2k Jan 4, 2023
Vegas is a jQuery/Zepto plugin to add beautiful backgrounds and Slideshows to DOM elements.

Vegas – Backgrounds and Slideshows Vegas is a jQuery/Zepto plugin to add beautiful backgrounds and Slideshows to DOM elements. Important note: Vegas 2

Jay Salvat 1.8k Jan 7, 2023
An awesome, fully responsive jQuery slider plugin

FlexSlider 2.7.2 http://www.woocommerce.com/flexslider/ - Copyright (c) 2015 WooThemes Releases The master branch of this repository is always the lat

WooCommerce 4.9k Jan 3, 2023
Nivo Slider - The Most Awesome jQuery Image Slider

Maintainer's Wanted! - Ineterested in contributing regularly to Nivo Slider development? Get in touch Nivo Slider The Nivo Slider is world renowned as

Verti Studio 1.2k Dec 24, 2022
Accordion Slider is a jQuery plugin that combines the functionality of a slider with that of an accordion.

Accordion Slider - jQuery slider plugin A responsive and touch-enabled jQuery accordion slider plugin that combines the functionality of a slider with

null 0 Dec 29, 2022
:snowboarder: A responsive slider jQuery plugin with CSS animations

A responsive slider jQuery plugin with CSS animations Animations from animate.css Online demo Visit plugin website. Appszoom for developers also uses

Joan Claret 58 Dec 12, 2022
Swiffy-slider - Super fast carousel and slider with touch for optimized websites running in modern browsers.

Swiffy Slider Super fast lightweight carousel and slider with touch for optimized websites running in modern browsers. Explore Swiffy Slider docs » Se

Dynamicweb Software A/S 149 Dec 28, 2022
A Responsive JQuery Slider

Turntable.js :: A Responsive JQuery Slider A jQuery plugin that will flip through a list of images as your mouse sweeps across a container Usage All i

Polar Notion 518 Nov 1, 2022
Responsive Tabs is a jQuery plugin that provides responsive tab functionality.

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.

Jelle Kralt 537 Dec 8, 2022
jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

fancyBox jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable. See the project page for doc

Jānis Skarnelis 7.2k Jan 2, 2023