Permalink
Browse files

use strict & cleanup

  • Loading branch information...
1 parent 08b570c commit 14308d1888bda30b6a6173885a455db046a59e22 @Mottie Mottie committed Sep 18, 2012
Showing with 21 additions and 10 deletions.
  1. +12 −0 README.markdown
  2. +6 −7 js/jquery.movingboxes.js
  3. +2 −2 js/jquery.movingboxes.min.js
  4. +1 −1 package.json
View
@@ -10,6 +10,18 @@
(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 (9/18/2012)
+
+* Added a method to check when all images have loaded, then reevaluate the height of each panel.
+ * The plugin that was incorporated is called [imagesLoaded](https://github.com/Mottie/imagesLoaded).
+ * This entailed rewritting and fixing the plugin initialization function ([issue #92](https://github.com/CSS-Tricks/MovingBoxes/issues/92) and initAnimation problems ([issue #79](https://github.com/CSS-Tricks/MovingBoxes/issues/79)).
+ * I hope this also includes fixing whatever is going on in [issue #62](https://github.com/CSS-Tricks/MovingBoxes/issues/62).
+* Added a `delayBeforeAnimate` option:
+ * The `beforeAnimation` event will be fired, then the animation will be delayed by the value in `delayBeforeAnimate` in milliseconds.
+ * See [issue #80](https://github.com/CSS-Tricks/MovingBoxes/issues/80) on how this could be useful :). Thanks to [Alfazo](https://github.com/Alfazo) for the suggestion.
+* Modified the layout so that the UL now gets the margin to center the panels within the frame instead of the first LI. This fixes the animation jump seen when switching from the second to first panel.
+* Removed byte order mark (BOM) from the js files. Fix for [issue #94](https://github.com/CSS-Tricks/MovingBoxes/issues/94).
+
### Version 2.2.16 (8/17/2012)
* Added new styling to the demo pages (Chris)
@@ -4,6 +4,7 @@
* http://css-tricks.com/moving-boxes/
*/
;(function($){
+ "use strict";
$.movingBoxes = function(el, options){
// To avoid scope issues, use 'base' instead of 'this'
// to reference this class from internal events and functions.
@@ -347,7 +348,7 @@
if (o.delayBeforeAnimate) {
// delay starting slide animation
- setTimeout(function(d){
+ setTimeout(function(){
base.animateBoxes(curPanel, ani, t, flag, callback);
}, parseInt(o.delayBeforeAnimate, 10) || 0);
} else {
@@ -384,14 +385,12 @@
};
base.endAnimation = function(){
-
// Update navigation links
if (o.buildNav && base.$nav.length) {
base.$nav.find('a.mb-link')
.removeClass(o.currentPanel)
.eq(base.curPanel - 1).addClass(o.currentPanel);
}
-
};
base.updateArrows = function(cur){
@@ -444,12 +443,12 @@
};
// based on https://github.com/Mottie/imagesLoaded plugin
- base.imagesLoaded = function(callback, img, cycling) {
+ base.imagesLoaded = function(callback, img) {
var i, ic,
c = true, // complete flag
t = img ? $(img) : base.$panels.find('img'),
- l = t.length,
- img = img || []; // array of images that didn't complete
+ l = t.length;
+ img = img || []; // array of images that didn't complete
for ( i = 0; i < l; i++ ) {
if (t[i].tagName === "IMG") {
// IE: fileSize property = -1 before image has loaded & if image load error, so if false is returned
@@ -472,7 +471,7 @@
} else {
// some images not loaded, rinse & repeat
setTimeout(function(){
- base.imagesLoaded( callback, img, true );
+ base.imagesLoaded(callback, img);
}, 200);
}
};
@@ -1,6 +1,6 @@
/*!
- * Moving Boxes v2.2.16 minified
+ * Moving Boxes v2.3 minified
* by Chris Coyier
* http://css-tricks.com/moving-boxes/
*/
-;(function(d){d.movingBoxes=function(h,i){var c,a=this;a.$el=d(h).addClass("mb-slider");a.el=h;a.$el.data("movingBoxes",a);a.init=function(){a.options=c=d.extend({},d.movingBoxes.defaultOptions,i);a.$el.wrap('<div class="movingBoxes mb-wrapper"><div class="mb-scroll" /></div>');a.$window=a.$el.parent();a.$wrap=a.$window.parent().prepend('<a class="mb-scrollButtons mb-left"></a>').append('<a class="mb-scrollButtons mb-right"></a><div class="mb-left-shadow"></div><div class="mb-right-shadow"></div>'); a.$panels=a.$el.children().addClass("mb-panel");a.runTime=d(".mb-slider").index(a.$el)+1;a.regex=RegExp("slider"+a.runTime+"=(\\d+)","i");a.initialized=!1;a.currentlyMoving=!1;a.curPanel=c.initAnimation?1:a.getHash()||c.startPanel;a.width=c.width?parseInt(c.width,10):a.$el.width();a.pWidth=c.panelWidth?2>=c.panelWidth?c.panelWidth*a.width:c.panelWidth:a.$panels.eq(0).width();a.$left=a.$wrap.find(".mb-left").click(function(){a.goBack();return!1});a.$right=a.$wrap.find(".mb-right").click(function(){a.goForward(); return!1});a.update(!1);d(window).load(function(){a.update()});a.$el.delegate(".mb-panel","click",function(b){d(this).hasClass(c.currentPanel)||(b.preventDefault(),a.change(a.$panels.index(d(this))+a.adj,{},!0))});a.$wrap.click(function(){a.$wrap.hasClass("mb-active-slider")||a.active()});a.$panels.delegate("a","focus",function(b){b.preventDefault();b=a.$panels.index(d(this).closest(".mb-panel"))+a.adj;b!==a.curPanel&&a.change(b,{},!0)});d(document).keyup(function(b){if(!b.target.tagName.match("TEXTAREA|INPUT|SELECT"))switch(b.which){case 39:case 32:a.$wrap.is(".mb-active-slider")&& a.goForward();break;case 37:a.$wrap.is(".mb-active-slider")&&a.goBack()}});d.each(["preinit","initialized","initChange","beforeAnimation","completed"],function(b,f){d.isFunction(c[f])&&a.$el.bind(f+".movingBoxes",c[f])});a.curPanel=a.getHash()||c.startPanel;a.$el.trigger("preinit.movingBoxes",[a,a.curPanel]);setTimeout(function(){a.change(a.curPanel,function(){a.initialized=!0;a.$el.trigger("initialized.movingBoxes",[a,a.curPanel])})},2*c.speed)};a.update=function(b,f){a.$el.children(".cloned").remove(); a.$panels=a.$el.children();a.adj=c.wrap&&1<a.$panels.length?0:1;a.width=c.width?parseInt(c.width,10):a.width;a.padding=parseInt(a.$panels.css("padding-left"),10)+parseInt(a.$panels.eq(1).css("margin-left"),10);a.$wrap.css("width",a.width);c.wrap&&1<a.$panels.length&&(a.$el.prepend(a.$panels.filter(":last").clone().addClass("cloned")),a.$el.append(a.$panels.filter(":first").clone().addClass("cloned")),a.$el.find(".cloned").each(function(){d(this).find("a,input,textarea,select,button,area").removeAttr("name").attr("disabled", "disabled");d(this).find("[id]").andSelf().removeAttr("id")}));a.$panels=a.$el.children().addClass("mb-panel").css("margin",0).each(function(){d(this).find(".mb-inside").length===0&&d(this).wrapInner('<div class="mb-inside" />')});a.totalPanels=a.$panels.filter(":not(.cloned)").length;a.curWidth=c.panelWidth?2>=c.panelWidth?c.panelWidth*a.width:c.panelWidth:a.pWidth;a.regWidth=a.curWidth*c.reducedSize;a.$panels.css({width:a.curWidth,fontSize:"1em"});a.$panels.eq(a.curPanel-a.adj).addClass(c.currentPanel); a.heights=a.$panels.map(function(a,b){return d(b).outerHeight(true)}).get();a.returnToNormal(a.curPanel,0);a.growBigger(a.curPanel,0,b);a.updateArrows(a.curPanel);a.$el.css({position:"absolute",width:(a.curWidth+100)*a.$panels.length+(a.width-a.curWidth)/2,height:Math.max.apply(this,a.heights)+10});a.$window.css({height:c.fixedHeight?Math.max.apply(this,a.heights):a.heights[a.curPanel-a.adj]});a.$panels.eq(0).css({"margin-left":(a.width-a.curWidth)/2});a.buildNav();a.change(a.curPanel,f,b)};a.buildNav= function(){a.$nav?a.$nav.find(".mb-links").empty():a.$nav=d('<div class="mb-controls"><span class="mb-links"></span></div>').appendTo(a.$wrap);if(c.buildNav&&1<a.totalPanels){var b,f,e="",g;a.$panels.filter(":not(.cloned)").each(function(h){f=h+1;e='<a class="mb-link mb-panel'+f+'" href="#"></a>';g=d(e);d.isFunction(c.navFormatter)?(b=c.navFormatter(f,d(this)),"string"===typeof b?g.html(b):g=d("<a/>",b)):g.html(f);g.appendTo(a.$nav.find(".mb-links")).addClass("mb-link mb-panel"+f).data("index",f)}); a.$nav.find("a.mb-link").bind("click",function(){a.change(d(this).data("index"));return!1})}};a.returnToNormal=function(b,d){var e=a.$panels.not(":eq("+(b-a.adj)+")").removeClass(c.currentPanel);1===c.reducedSize?e.css({width:a.regWidth}):e.stop(!0,!1).animate({width:a.regWidth,fontSize:c.reducedSize+"em"},0===d?0:c.speed)};a.growBigger=function(b,d,e){var g=a.$panels.eq(b-a.adj);1===c.reducedSize?(g.css({width:a.curWidth}),setTimeout(function(){a.completed(b,e)},0===d?0:c.speed)):g.stop(!0,!1).animate({width:a.curWidth, fontSize:"1em"},0===d?0:c.speed,function(){a.completed(b,e)})};a.completed=function(b,d){var e=a.$panels.eq(b-a.adj);e.hasClass("cloned")||e.addClass(c.currentPanel);!1!==d&&a.$el.trigger("completed.movingBoxes",[a,b])};a.goForward=function(b){a.initialized&&a.change(a.curPanel+1,b)};a.goBack=function(b){a.initialized&&a.change(a.curPanel-1,b)};a.change=function(b,f,e){if(1>a.totalPanels)"function"===typeof f&&f(a);else{var g,h,i=!1;h=(e=!1!==e)?c.speed:0;b=/^[#|.]/.test(b)&&d(b).length?d(b).closest(".mb-panel").index()+ a.adj:parseInt(b,10);a.initialized&&e&&(a.$wrap.hasClass("mb-active-slider")||a.active(),a.$el.trigger("initChange.movingBoxes",[a,b]));c.wrap&&(b>a.totalPanels?(i=!0,b=1,a.returnToNormal(0,0),a.growBigger(0,0,!1),g=a.$panels.eq(0).position().left-(a.width-a.curWidth)/2+a.padding,a.$window.scrollLeft(g)):0===b&&(i=!1,b=a.totalPanels,a.growBigger(b+1,0,!1),g=a.$panels.eq(b+1).position().left-(a.width-a.curWidth)/2+a.padding,a.$window.scrollLeft(g)));b<a.adj&&(b=c.wrap?a.totalPanels:1);b>a.totalPanels- a.adj&&(b=c.wrap?1:a.totalPanels);if(!a.currentlyMoving||!a.initialized){a.currentlyMoving=!c.stopAnimation;a.$curPanel=a.$panels.eq(b-a.adj);g=a.$curPanel.position().left-(a.width-a.curWidth)/2+a.padding;if(b>a.curPanel||i)g-=a.curWidth-a.regWidth;g=c.fixedHeight?{scrollLeft:g}:{scrollLeft:g,height:a.heights[b-a.adj]};a.curPanel=b;a.initialized&&e&&a.$el.trigger("beforeAnimation.movingBoxes",[a,b]);a.$window.scrollTop(0).stop(!0,!1).animate(g,{queue:!1,duration:h,easing:c.easing,complete:function(){a.initialized&& a.$window.scrollTop(0);a.currentlyMoving=false;typeof f==="function"&&f(a)}});a.returnToNormal(b,h);a.growBigger(b,h,e);a.updateArrows(b);c.hashTags&&a.initialized&&a.setHash(b)}c.buildNav&&a.$nav.length&&a.$nav.find("a.mb-link").removeClass(c.currentPanel).eq(b-1).addClass(c.currentPanel)}};a.updateArrows=function(b){a.$left.toggleClass(c.disabled,!c.wrap&&b===a.adj);a.$right.toggleClass(c.disabled,!c.wrap&&(b===a.totalPanels||0===a.totalPanels))};a.getHash=function(){var b=window.location.hash, f=b.indexOf("&"),e=b.match(a.regex);null===e&&!/^#&/.test(b)&&!/#!?\//.test(b)?(b=b.substring(0,0<=f?f:b.length),e=d(b).length&&d(b).closest(".mb-slider")[0]===a.el?d(b).closest(".mb-panel").index()+a.adj:null):null!==e&&(e=c.hashTags?parseInt(e[1],10):null);return e};a.setHash=function(b){var c="slider"+a.runTime+"=",d=window.location.hash;"undefined"!==typeof d&&(window.location.hash=0<d.indexOf(c)?d.replace(a.regex,c+b):d+"&"+c+b)};a.active=function(){d(".mb-active-slider").removeClass("mb-active-slider"); a.$wrap.addClass("mb-active-slider")};a.currentPanel=function(b,c){"undefined"!==typeof b&&a.change(b,c);return a.curPanel};a.init()};d.movingBoxes.defaultOptions={startPanel:1,reducedSize:0.8,fixedHeight:!1,speed:500,initAnimation:!0,stopAnimation:!1,hashTags:!0,wrap:!1,buildNav:!1,navFormatter:null,easing:"swing",currentPanel:"current",tooltipClass:"tooltip",disabled:"disabled",preinit:null,initialized:null,initChange:null,beforeAnimation:null,completed:null};d.fn.movingBoxes=function(h,i,c){var a, b;return this.each(function(){b=d(this).data("movingBoxes");(typeof h).match("object|undefined")?b?b.update():new d.movingBoxes(this,h):/\d/.test(h)&&(!isNaN(h)&&b)&&(a="number"===typeof h?h:parseInt(d.trim(h),10),1<=a&&a<=b.totalPanels&&b.change(a,i,c))})};d.fn.getMovingBoxes=function(){return this.data("movingBoxes")}})(jQuery);
+;(function(e){e.movingBoxes=function(g,k){var c,a=this;a.$el=e(g).addClass("mb-slider");a.el=g;a.$el.data("movingBoxes",a);a.init=function(){a.options=c=e.extend({},e.movingBoxes.defaultOptions,k);a.$el.wrap('<div class="movingBoxes mb-wrapper"><div class="mb-scroll" /></div>');a.$window=a.$el.parent();a.$wrap=a.$window.parent().prepend('<a class="mb-scrollButtons mb-left"></a>').append('<a class="mb-scrollButtons mb-right"></a><div class="mb-left-shadow"></div><div class="mb-right-shadow"></div>'); a.$panels=a.$el.children().addClass("mb-panel");a.runTime=e(".mb-slider").index(a.$el)+1;a.regex=RegExp("slider"+a.runTime+"=(\\d+)","i");a.initialized=!1;a.currentlyMoving=!1;a.curPanel=c.initAnimation?1:a.getHash()||c.startPanel;a.width=c.width?parseInt(c.width,10):a.$el.width();a.pWidth=c.panelWidth?2>=c.panelWidth?c.panelWidth*a.width:c.panelWidth:a.$panels.eq(0).width();a.$left=a.$wrap.find(".mb-left").click(function(){a.goBack();return!1});a.$right=a.$wrap.find(".mb-right").click(function(){a.goForward(); return!1});a.update(!1);a.$el.delegate(".mb-panel","click",function(b){e(this).hasClass(c.currentPanel)||(b.preventDefault(),a.change(a.$panels.index(e(this))+a.adj,{},!0))});a.$wrap.click(function(){a.$wrap.hasClass("mb-active-slider")||a.active()});a.$panels.delegate("a","focus",function(b){b.preventDefault();b=a.$panels.index(e(this).closest(".mb-panel"))+a.adj;b!==a.curPanel&&a.change(b,{},!0)});e(document).keyup(function(b){if(!b.target.tagName.match("TEXTAREA|INPUT|SELECT"))switch(b.which){case 39:case 32:a.$wrap.is(".mb-active-slider")&& a.goForward();break;case 37:a.$wrap.is(".mb-active-slider")&&a.goBack()}});e.each(["preinit","initialized","initChange","beforeAnimation","completed"],function(b,f){e.isFunction(c[f])&&a.$el.bind(f+".movingBoxes",c[f])});a.$el.trigger("preinit.movingBoxes",[a,a.curPanel])};a.update=function(b,f){a.$el.children(".cloned").remove();a.$panels=a.$el.children();a.adj=c.wrap&&1<a.$panels.length?0:1;a.width=c.width?parseInt(c.width,10):a.width;a.$wrap.css("width",a.width);c.wrap&&1<a.$panels.length&&(a.$el.prepend(a.$panels.filter(":last").clone().addClass("cloned")), a.$el.append(a.$panels.filter(":first").clone().addClass("cloned")),a.$el.find(".cloned").each(function(){e(this).find("a,input,textarea,select,button,area").removeAttr("name").attr("disabled","disabled");e(this).find("[id]").andSelf().removeAttr("id")}));a.$panels=a.$el.children().addClass("mb-panel").each(function(){e(this).find(".mb-inside").length===0&&e(this).wrapInner('<div class="mb-inside" />')});a.totalPanels=a.$panels.filter(":not(.cloned)").length;a.setSizes(b);a.buildNav();a.change(a.curPanel, f,b);a.imagesLoaded(function(){a.setSizes(false);a.change(a.curPanel,{},false);a.initialized||setTimeout(function(){a.change(a.getHash()||c.startPanel);a.initialized=true;a.$el.trigger("initialized.movingBoxes",[a,a.curPanel])},c.speed*2)})};a.setSizes=function(b){a.padding=parseInt(a.$panels.css("padding-left"),10)+parseInt(a.$panels.css("margin-left"),10);a.curWidth=c.panelWidth?2>=c.panelWidth?c.panelWidth*a.width:c.panelWidth:a.pWidth;a.regWidth=a.curWidth*c.reducedSize;a.$panels.css({width:a.curWidth, fontSize:"1em"});a.$panels.eq(a.curPanel-a.adj).addClass(c.currentPanel);a.heights=a.$panels.css("height","auto").map(function(a,b){return e(b).outerHeight(!0)}).get();a.returnToNormal(a.curPanel,0);a.growBigger(a.curPanel,0,b);a.updateArrows(a.curPanel);a.$el.css({position:"absolute",width:(a.curWidth+2*a.padding)*a.$panels.length+(a.width-a.curWidth)/2,height:Math.max.apply(this,a.heights)+10,"padding-left":(a.width-a.curWidth)/2});a.$window.css({height:c.fixedHeight?Math.max.apply(this,a.heights): a.heights[a.curPanel-a.adj]})};a.buildNav=function(){a.$nav?a.$nav.find(".mb-links").empty():a.$nav=e('<div class="mb-controls"><span class="mb-links"></span></div>').appendTo(a.$wrap);if(c.buildNav&&1<a.totalPanels){var b,f,d="",j;a.$panels.filter(":not(.cloned)").each(function(i){f=i+1;d='<a class="mb-link mb-panel'+f+'" href="#"></a>';j=e(d);e.isFunction(c.navFormatter)?(b=c.navFormatter(f,e(this)),"string"===typeof b?j.html(b):j=e("<a/>",b)):j.html(f);j.appendTo(a.$nav.find(".mb-links")).addClass("mb-link mb-panel"+ f).data("index",f)});a.$nav.find("a.mb-link").bind("click",function(){a.change(e(this).data("index"));return!1})}};a.returnToNormal=function(b,f){var d=a.$panels.not(":eq("+(b-a.adj)+")").removeClass(c.currentPanel);1===c.reducedSize?d.css({width:a.regWidth}):d.stop(!0,!1).animate({width:a.regWidth,fontSize:c.reducedSize+"em"},0===f?0:c.speed)};a.growBigger=function(b,f,d){var e=a.$panels.eq(b-a.adj);1===c.reducedSize?(e.css({width:a.curWidth}),setTimeout(function(){a.completed(b,d)},0===f?0:c.speed)): e.stop(!0,!1).animate({width:a.curWidth,fontSize:"1em"},0===f?0:c.speed,function(){a.completed(b,d)})};a.setWrap=function(b){a.growBigger(b,0,!1);b=a.$panels.eq(b).position().left-(a.width-a.curWidth)/2+a.padding;a.$window.scrollLeft(b)};a.completed=function(b,f){var d=a.$panels.eq(b-a.adj);d.hasClass("cloned")||d.addClass(c.currentPanel);!1!==f&&a.$el.trigger("completed.movingBoxes",[a,b])};a.goForward=function(b){a.initialized&&a.change(a.curPanel+1,b)};a.goBack=function(b){a.initialized&&a.change(a.curPanel- 1,b)};a.change=function(b,f,d){if(1>a.totalPanels)"function"===typeof f&&f(a);else{var j,i,h,g=!1;h=(d=!1!==d)?c.speed:0;b=/^[#|.]/.test(b)&&e(b).length?e(b).closest(".mb-panel").index()+a.adj:parseInt(b,10);a.initialized&&d&&(a.$wrap.hasClass("mb-active-slider")||a.active(),a.$el.trigger("initChange.movingBoxes",[a,b]));c.wrap&&(b>a.totalPanels?(g=!0,b=1,a.returnToNormal(0,0),a.setWrap(0)):0===b&&(g=!1,b=a.totalPanels,a.setWrap(b+1)));b<a.adj&&(b=c.wrap?a.totalPanels:1);b>a.totalPanels-a.adj&&(b= c.wrap?1:a.totalPanels);if(a.curPanel!==b&&(!a.currentlyMoving||!a.initialized)){a.currentlyMoving=!c.stopAnimation;a.$curPanel=a.$panels.eq(b-a.adj);i=a.$curPanel.position().left-(a.width-a.curWidth)/2+a.padding;if(b>a.curPanel||g)i-=a.curWidth-a.regWidth;j=c.fixedHeight?{scrollLeft:i}:{scrollLeft:i,height:a.heights[b-a.adj]};a.curPanel=b;a.initialized&&d&&a.$el.trigger("beforeAnimation.movingBoxes",[a,b]);c.delayBeforeAnimate?setTimeout(function(){a.animateBoxes(b,j,h,d,f)},parseInt(c.delayBeforeAnimate, 10)||0):a.animateBoxes(b,j,h,d,f)}else a.endAnimation()}};a.animateBoxes=function(b,f,d,e,g){a.$window.scrollTop(0).stop(!0,!1).animate(f,{queue:!1,duration:d,easing:c.easing,complete:function(){a.initialized&&a.$window.scrollTop(0);a.currentlyMoving=!1;"function"===typeof g&&g(a)}});a.returnToNormal(b,d);a.growBigger(b,d,e);a.updateArrows(b);c.hashTags&&a.initialized&&a.setHash(b);a.endAnimation()};a.endAnimation=function(){c.buildNav&&a.$nav.length&&a.$nav.find("a.mb-link").removeClass(c.currentPanel).eq(a.curPanel- 1).addClass(c.currentPanel)};a.updateArrows=function(b){a.$left.toggleClass(c.disabled,!c.wrap&&b===a.adj);a.$right.toggleClass(c.disabled,!c.wrap&&(b===a.totalPanels||0===a.totalPanels))};a.getHash=function(){var b=window.location.hash,f=b.indexOf("&"),d=b.match(a.regex);null===d&&!/^#&/.test(b)&&!/#!?\//.test(b)?(b=b.substring(0,0<=f?f:b.length),d=e(b).length&&e(b).closest(".mb-slider")[0]===a.el?e(b).closest(".mb-panel").index()+a.adj:null):null!==d&&(d=c.hashTags?parseInt(d[1],10):null);return d}; a.setHash=function(b){var c="slider"+a.runTime+"=",d=window.location.hash;"undefined"!==typeof d&&(window.location.hash=0<d.indexOf(c)?d.replace(a.regex,c+b):d+"&"+c+b)};a.active=function(){e(".mb-active-slider").removeClass("mb-active-slider");a.$wrap.addClass("mb-active-slider")};a.currentPanel=function(b,c){"undefined"!==typeof b&&a.change(b,c);return a.curPanel};a.imagesLoaded=function(b,c){var d,g,i=!0,h=c?e(c):a.$panels.find("img"),k=h.length,c=c||[];for(d=0;d<k;d++)"IMG"===h[d].tagName&&(g= "fileSize"in h[d]&&0>h[d].fileSize&&10<h[d].count?!0:h[d].complete,i=i&&g&&0!==h[d].height,!1===g&&(c.push(h[d]),h[d].count=(h[d].count||0)+1));i?"function"===typeof b&&b():setTimeout(function(){a.imagesLoaded(b,c)},200)};a.init()};e.movingBoxes.defaultOptions={startPanel:1,reducedSize:0.8,fixedHeight:!1,initAnimation:!0,stopAnimation:!1,hashTags:!0,wrap:!1,buildNav:!1,navFormatter:null,easing:"swing",speed:500,delayBeforeAnimate:0,currentPanel:"current",tooltipClass:"tooltip",disabled:"disabled", preinit:null,initialized:null,initChange:null,beforeAnimation:null,completed:null};e.fn.movingBoxes=function(g,k,c){var a,b;return this.each(function(){b=e(this).data("movingBoxes");(typeof g).match("object|undefined")?b?b.update():new e.movingBoxes(this,g):/\d/.test(g)&&(!isNaN(g)&&b)&&(a="number"===typeof g?g:parseInt(e.trim(g),10),1<=a&&a<=b.totalPanels&&b.change(a,k,c))})};e.fn.getMovingBoxes=function(){return this.data("movingBoxes")}})(jQuery);
View
@@ -1,6 +1,6 @@
{
"name": "MovingBoxes",
- "version": "2.2.16",
+ "version": "2.3",
"title": "MovingBoxes",
"author": {
"name": "Chris Coyier",

0 comments on commit 14308d1

Please sign in to comment.