Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed Apr 16, 2014
1 parent c7ece9a commit 127fb0a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SimpleSlider
============

version: 0.2.5
version: 0.3.0

[![Build Status](https://travis-ci.org/ruyadorno/SimpleSlider.png?branch=develop)](https://travis-ci.org/ruyadorno/SimpleSlider)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SimpleSlider",
"version": "0.2.5",
"version": "0.3.0",
"description": "A simple javascript slider without any dependencies",
"homepage": "http://ruyadorno.github.io/SimpleSlider/",
"authors": [
Expand Down
29 changes: 20 additions & 9 deletions dist/simpleslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,26 @@
return false;
}

if (this.autoPlay && this.imgs.length > 1) {
this.startInterval();

var scope = this;
};

if (this.interval) {
window.clearInterval(this.interval);
}
SimpleSlider.prototype.startInterval = function () {

var self = this;

if (!this.autoPlay || this.imgs.length <= 1) {
return;
}

this.interval = window.setInterval(function(){
scope.change(scope.nextIndex());
}, this.delay * 1000);
if (this.interval) {
window.clearInterval(this.interval);
}

this.interval = window.setInterval(function(){
self.change(self.nextIndex());
}, this.delay * 1000);

};

SimpleSlider.prototype.startAnim = function(target, fromValue, toValue){
Expand Down Expand Up @@ -307,12 +314,16 @@

this.change(this.nextIndex());

this.startInterval();

};

SimpleSlider.prototype.prev = function(){

this.change(this.prevIndex());

this.startInterval();

};

SimpleSlider.prototype.nextIndex = function(){
Expand All @@ -331,7 +342,7 @@

var newIndex = this.actualIndex-1;

if (newIndex <= 0) {
if (newIndex < 0) {
newIndex = this.imgs.length-1;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/simpleslider.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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-slider",
"version": "0.2.5",
"version": "0.3.0",
"description": "A simple javascript slider without any dependencies",
"scripts": {
"test": "grunt jasmine"
Expand Down

0 comments on commit 127fb0a

Please # to comment.