Permalink
Browse files

Looped MovingBoxes now start on the correct slide. Fixes issue #97.

  • Loading branch information...
1 parent 14308d1 commit ae8fec720fb7779eab22e247cc0ace3c10585df4 @Mottie Mottie committed Oct 9, 2012
Showing with 11 additions and 5 deletions.
  1. +4 −0 README.markdown
  2. +4 −2 js/jquery.movingboxes.js
  3. +2 −2 js/jquery.movingboxes.min.js
  4. +1 −1 package.json
View
@@ -10,6 +10,10 @@
(Only the most recent changes are shown below, see the [wiki page](https://github.com/CSS-Tricks/MovingBoxes/wiki/Change-Log) for a complete listing)
+### Version 2.3.1 (10/9/2012)
+
+* MovingBoxes will no longer start on the first cloned panel when the `wrap` option is set to `true`. Fixes [issue #97](https://github.com/CSS-Tricks/MovingBoxes/issues/97).
+
### Version 2.3 (9/18/2012)
* Added a method to check when all images have loaded, then reevaluate the height of each panel.
View
@@ -1,5 +1,5 @@
/*!
- * Moving Boxes v2.3
+ * Moving Boxes v2.3.1
* by Chris Coyier
* http://css-tricks.com/moving-boxes/
*/
@@ -53,6 +53,8 @@
});
// code to run to update MovingBoxes when the number of panels change
base.update(false);
+ // make sure current panel is centered
+ base.setWrap(base.curPanel);
// set current panel
//if (o.initAnimation) { base.change(base.curPanel, {}, false); }
// go to clicked panel
@@ -260,6 +262,7 @@
}
};
+ // instantly center the indicated panel
base.setWrap = function(panel){
base.growBigger(panel, 0, false);
var leftValue = base.$panels.eq(panel).position().left - (base.width - base.curWidth) / 2 + base.padding;
@@ -329,7 +332,6 @@
if ( curPanel < base.adj ) { curPanel = (o.wrap) ? base.totalPanels : 1; }
if ( curPanel > base.totalPanels - base.adj ) { curPanel = (o.wrap) ? 1 : base.totalPanels; }
-
// abort if panel is already animating
// animation callback needed to clear this flag, but there is no animation before base.initialized is set
if (base.curPanel !== curPanel && (!base.currentlyMoving || !base.initialized)) {
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "MovingBoxes",
- "version": "2.3",
+ "version": "2.3.1",
"title": "MovingBoxes",
"author": {
"name": "Chris Coyier",

0 comments on commit ae8fec7

Please sign in to comment.