Skip to content

Commit 8509be8

Browse files
Peter TranPeter Tran
Peter Tran
authored and
Peter Tran
committed
bugfix
1 parent 161e2d3 commit 8509be8

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

jquery.cyclify.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
};
5858

5959
Cycler.prototype._set_current_cycle = function(num) {
60-
this.elements.current_index = num;
60+
this.elements.current_index = parseInt(num);
6161
this.elements.cycles.removeClass('current-cycle');
6262
this.elements.cycles.hide();
6363
$(this.elements.cycles[num]).show(this.settings.delay, this.settings.transition).addClass('current-cycle');
@@ -93,24 +93,18 @@
9393
}
9494
};
9595

96-
Cycler.prototype.begin = function() {
97-
if (this.elements.current_index !== 0) {
98-
this._set_current_cycle(0);
99-
this.callback_if_necessary();
100-
}
96+
Cycler.prototype.end = function() {
97+
this._set_current_cycle(0);
98+
this.callback_if_necessary();
10199
};
102100

103-
Cycler.prototype.end = function() {
104-
if (this.elements.current_index !== (this.elements.max - 1)) {
105-
this._set_current_cycle(this.elements.max - 1);
106-
this.callback_if_necessary();
107-
}
101+
Cycler.prototype.begin = function() {
102+
this._set_current_cycle(this.elements.max - 1);
103+
this.callback_if_necessary();
108104
};
109105

110106
return new Cycler(this, options);
111107
}
112108
});
113109
})(jQuery);
114110

115-
116-

0 commit comments

Comments
 (0)