Skip to content

Commit

Permalink
Version 2.2.0 - fixing a few bugs and adding a new responsive pattern…
Browse files Browse the repository at this point in the history
… by making slider vars public.
  • Loading branch information
Tyler Smith committed Jan 26, 2013
1 parent 54e6d31 commit 0ef4a10
Show file tree
Hide file tree
Showing 11 changed files with 474 additions and 203 deletions.
13 changes: 11 additions & 2 deletions README.mdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# FlexSlider 2
http://www.woothemes.com/flexslider/ - Copyright (c) 2012 WooThemes

Documentation guides for properties and theming are coming soon. Shortly thereafter, the download builder will be released, where you can create minified FlexSlider scripts that contain only the properties you need. It's a brave new world.
## Updates

** Version 2.2 / January 25, 2013**

- 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](http://flexslider.woothemes.com/dynamic-carousel-min-max.html)
- Fixed calculations that were causing strange issues with paging and certain FlexSliders to out of alignment.

*Be sure to test v2.2 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 shares the common licensed used for all WooThemes themes, GPLv2.
Expand All @@ -10,7 +20,6 @@ In an effort to move the plugin forward, support for jQuery 1.3.2 has been dropp

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.

## Updates
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')`
Expand Down
4 changes: 3 additions & 1 deletion demo/basic-carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h3>Other Examples</h3>
<li><a href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a class="active" href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down Expand Up @@ -151,6 +152,7 @@ <h3>Basic Carousel</h3>
animationLoop: false,
itemWidth: 210,
itemMargin: 5,
pausePlay: true,
start: function(slider){
$('body').removeClass('loading');
}
Expand Down
3 changes: 2 additions & 1 deletion demo/carousel-min-max.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h3>Other Examples</h3>
<li><a href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a class="active" href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a class="active" href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down
229 changes: 229 additions & 0 deletions demo/dynamic-carousel-min-max.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta content="charset=utf-8">
<title>FlexSlider 2</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

<!-- Syntax Highlighter -->
<link href="css/shCore.css" rel="stylesheet" type="text/css" />
<link href="css/shThemeDefault.css" rel="stylesheet" type="text/css" />
<!-- Demo CSS -->
<link rel="stylesheet" href="css/demo.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../flexslider.css" type="text/css" media="screen" />

<!-- Modernizr -->
<script src="js/modernizr.js"></script>

</head>
<body class="loading">

<div id="top">

<a href="http://www.woothemes.com" title="WooThemes">
<img src="images/logo.png" alt="WooThemes" />
</a>

</div>

<div id="container" class="cf">
<header role="navigation">
<h1>FlexSlider 2</h1>
<h2>The best responsive slider. Period.</h2>
<a class="button green" href="https://github.com/woothemes/FlexSlider/zipball/master">Download Flexslider</a>
<nav>
<h3>Other Examples</h3>
<ul>
<li><a href="demo">Basic Slider</a></li>
<li><a href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a class="active" href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
</header>

<div id="main" role="main">
<section class="slider">
<div class="flexslider carousel">
<ul class="slides">
<li>
<img src="images/kitchen_adventurer_cheesecake_brownie.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_lemon.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_donut.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_caramel.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_cheesecake_brownie.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_lemon.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_donut.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_caramel.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_cheesecake_brownie.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_lemon.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_donut.jpg" />
</li>
<li>
<img src="images/kitchen_adventurer_caramel.jpg" />
</li>
</ul>
</div>
</section>
<aside>
<div class="cf">
<h3>Carousel With Min &amp; Max Ranges</h3>
<ul class="toggle cf">
<li class="js"><a href="#view-js">JS</a></li>
<li class="html"><a href="#view-html">HTML</a></li>
</ul>
</div>
<div id="view-js" class="code">
<pre class="brush: js; toolbar: false; gutter: false;">
(function() {

// store the slider in a local variable
var $window = $(window),
flexslider;

// tiny helper function to add breakpoints
function getGridSize() {
return (window.innerWidth < 600) ? 2 :
(window.innerWidth < 900) ? 3 : 4;
}

$(function() {
SyntaxHighlighter.all();
});

$window.load(function() {
$('.flexslider').flexslider({
animation: "slide",
animationLoop: false,
itemWidth: 210,
itemMargin: 5,
minItems: getGridSize(), // use function to pull in initial value
maxItems: getGridSize() // use function to pull in initial value
});
});

// check grid size on resize event
$window.resize(function() {
var gridSize = getGridSize();

flexslider.vars.minItems = gridSize;
flexslider.vars.maxItems = gridSize;
});
}());
</pre>
</div>
<div id="view-html" class="code">
<pre class="brush: xml; toolbar: false; gutter: false;">
&lt;!-- Place somewhere in the &lt;body&gt; of your page -->
&lt;div class="flexslider">
&lt;ul class="slides">
&lt;li>
&lt;img src="slide1.jpg" />
&lt;/li>
&lt;li>
&lt;img src="slide2.jpg" />
&lt;/li>
&lt;li>
&lt;img src="slide3.jpg" />
&lt;/li>
&lt;li>
&lt;img src="slide4.jpg" />
&lt;/li>
&lt;!-- items mirrored twice, total of 12 -->
&lt;/ul>
&lt;/div>
</pre>
</div>
</aside>
</div>

</div>

<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.min.js">\x3C/script>')</script>

<!-- FlexSlider -->
<script defer src="../jquery.flexslider.js"></script>

<script type="text/javascript">

(function() {

// store the slider in a local variable
var $window = $(window),
flexslider;

// tiny helper function to add breakpoints
function getGridSize() {
return (window.innerWidth < 600) ? 2 :
(window.innerWidth < 900) ? 3 : 4;
}

$(function() {
SyntaxHighlighter.all();
});

$window.load(function() {
$('.flexslider').flexslider({
animation: "slide",
animationSpeed: 400,
animationLoop: false,
itemWidth: 210,
itemMargin: 5,
minItems: getGridSize(), // use function to pull in initial value
maxItems: getGridSize(), // use function to pull in initial value
start: function(slider){
$('body').removeClass('loading');
flexslider = slider;
}
});
});

// check grid size on resize event
$window.resize(function() {
var gridSize = getGridSize();

flexslider.vars.minItems = gridSize;
flexslider.vars.maxItems = gridSize;
});
}());

</script>


<!-- Syntax Highlighter -->
<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>

<!-- Optional FlexSlider Additions -->
<script src="js/jquery.easing.js"></script>
<script src="js/jquery.mousewheel.js"></script>
<script defer src="js/demo.js"></script>

</body>
</html>
3 changes: 2 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h3>Other Examples</h3>
<li><a href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down
7 changes: 5 additions & 2 deletions demo/thumbnail-controlnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h3>Other Examples</h3>
<li><a class="active" href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down Expand Up @@ -113,7 +114,9 @@ <h3>Thumbnail ControlNav Pattern</h3>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.min.js">\x3C/script>')</script>

<!-- FlexSlider -->
<script defer src="../jquery.flexslider.js"></script><script type="text/javascript">
<script defer src="../jquery.flexslider.js"></script>

<script type="text/javascript">
$(function(){
SyntaxHighlighter.all();
});
Expand Down
3 changes: 2 additions & 1 deletion demo/thumbnail-slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h3>Other Examples</h3>
<li><a href="thumbnail-controlnav.html">Slider w/thumbnail controlNav pattern</a></li>
<li><a class="active" href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down
1 change: 1 addition & 0 deletions demo/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h3>Other Examples</h3>
<li><a href="thumbnail-slider.html">Slider w/thumbnail slider</a></li>
<li><a href="basic-carousel.html">Basic Carousel</a></li>
<li><a href="carousel-min-max.html">Carousel with min and max ranges</a></li>
<li><a href="dynamic-carousel-min-max.html">Carousel with dynamic min/max ranges</a></li>
<li><a class="active" href="video.html">Video & the api (vimeo)</a></li>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion flexslider.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery FlexSlider v2.0
* jQuery FlexSlider v2.2.0
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
Expand Down
Loading

0 comments on commit 0ef4a10

Please sign in to comment.