Skip to content

Commit

Permalink
passing current slide number in start and complete callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansearles committed Feb 8, 2013
1 parent 0d6c185 commit 8d9d555
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions examples/basic/js/jquery.slides.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/multiple/js/jquery.slides.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/playing/js/jquery.slides.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/standard/js/jquery.slides.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/jquery.slides.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions source/jquery.slides.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
callback:
loaded: () ->
# [function] Called when slides is loaded
start: () ->
start: (e) ->
# [function] Called when animation has started
complete: () ->
complete: (e) ->
# [function] Called when animation is complete

class Plugin
Expand Down Expand Up @@ -588,7 +588,7 @@
zIndex: 10

# Start the slide animation
@options.callback.start()
@options.callback.start(currentSlide)

if @data.vendorPrefix
# If supported use CSS3 for the animation
Expand Down Expand Up @@ -637,7 +637,7 @@
@_setuptouch() if @data.touch

# End of the animation, call complete callback
@options.callback.complete()
@options.callback.complete(next)
else
# If CSS3 isn't support use JavaScript for the animation
slidesControl.stop().animate
Expand All @@ -657,7 +657,7 @@
$.data this, "animating", false

# End of the animation, call complete callback
@options.callback.complete()
@options.callback.complete(next)
)

# @_fade()
Expand Down Expand Up @@ -704,7 +704,7 @@
zIndex: 0

# Start of the animation, call the start callback
@options.callback.start()
@options.callback.start(currentSlide)

if @options.effect.fade.crossfade
# Crossfade to next slide
Expand Down
14 changes: 7 additions & 7 deletions source/jquery.slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Documentation and examples http://slidesjs.com
# Support forum http://groups.google.com/group/slidesjs
# Version: 3.0.2f beta
# Version: 3.0.2g beta
# Updated: February 8th, 2013
# SlidesJS is an open source project, contribute at GitHub:
Expand Down Expand Up @@ -65,8 +65,8 @@
},
callback: {
loaded: function() {},
start: function() {},
complete: function() {}
start: function(e) {},
complete: function(e) {}
}
};
Plugin = (function() {
Expand Down Expand Up @@ -476,7 +476,7 @@
left: value * this.options.width,
zIndex: 10
});
this.options.callback.start();
this.options.callback.start(currentSlide);
if (this.data.vendorPrefix) {
prefix = this.data.vendorPrefix;
transform = prefix + "Transform";
Expand Down Expand Up @@ -508,7 +508,7 @@
if (_this.data.touch) {
_this._setuptouch();
}
return _this.options.callback.complete();
return _this.options.callback.complete(next);
});
} else {
return slidesControl.stop().animate({
Expand All @@ -524,7 +524,7 @@
display: "none",
left: 0,
zIndex: 0
}, $.data(_this, "current", next), $.data(_this, "animating", false), _this.options.callback.complete());
}, $.data(_this, "current", next), $.data(_this, "animating", false), _this.options.callback.complete(next));
}));
}
}
Expand Down Expand Up @@ -558,7 +558,7 @@
left: 0,
zIndex: 0
});
this.options.callback.start();
this.options.callback.start(currentSlide);
if (this.options.effect.fade.crossfade) {
return slidesControl.children(":eq(" + this.data.current + ")").stop().fadeOut(this.options.effect.fade.speed, (function() {
slidesControl.children(":eq(" + next + ")").css({
Expand Down
4 changes: 2 additions & 2 deletions source/jquery.slides.min.js

Large diffs are not rendered by default.

0 comments on commit 8d9d555

Please sign in to comment.