Skip to content

Commit

Permalink
增加新特性,每次切换都可以改变动画
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyu33333 committed Mar 18, 2017
1 parent 09ed6cc commit 9c5204a
Show file tree
Hide file tree
Showing 17 changed files with 556 additions and 260 deletions.
2 changes: 1 addition & 1 deletion build/iSlider.animate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions build/iSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,21 @@
this.fire('renderComplete', this.slideIndex, this.currentEl, this);
};

/**
* resetAnimation, slideTo每次切换使用不同的动画时调用
* @private
*/
iSliderPrototype._resetAnimation = function () {
var els = this.els;
for (var i = 0; i < 3; i++) {
els[i].style.cssText = '';
this._animateFunc(els[i], this.axis, this.scale, i, 0);
this.isVertical && (this.animateType === 'rotate' || this.animateType === 'flip')
? this._renderItem(els[i], 1 - i + this.slideIndex)
: this._renderItem(els[i], i - 1 + this.slideIndex);
}
}

/**
* Preload img when slideChange
* From current index +2, -2 scene
Expand Down Expand Up @@ -1412,6 +1427,9 @@
if (typeof opts.animateType === 'string' && opts.animateType in this._animateFuncs) {
animateType = opts.animateType;
animateFunc = this._animateFuncs[animateType];
this._animateFunc = animateFunc;
this.animateType = animateType;
this._resetAnimation();
}
}

Expand Down
2 changes: 1 addition & 1 deletion build/iSlider.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/iSlider.plugin.BIZone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/iSlider.plugin.button.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/iSlider.plugin.dot.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c5204a

Please sign in to comment.