Skip to content

Commit

Permalink
Merge pull request #835 from molotoff/master
Browse files Browse the repository at this point in the history
Add animation method to Autoscroll plugin
  • Loading branch information
snake-345 committed May 31, 2018
2 parents 516e626 + 86b6912 commit e9d7d31
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 25 deletions.
7 changes: 4 additions & 3 deletions dist/jquery.jcarousel-autoscroll.js
@@ -1,4 +1,4 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($, document) {
Expand Down Expand Up @@ -26,7 +26,8 @@
_options: {
target: '+=1',
interval: 3000,
autostart: true
autostart: true,
method: 'scroll'
},
_timer: null,
_started: false,
Expand Down Expand Up @@ -78,7 +79,7 @@
.one('jcarousel:animateend', this.onAnimateEnd);

this._timer = setTimeout($.proxy(function() {
this.carousel().jcarousel('scroll', this.options('target'));
this.carousel().jcarousel(this.options('method'), this.options('target'));
}, this), this.options('interval'));

return this;
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.jcarousel-autoscroll.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 dist/jquery.jcarousel-control.js
@@ -1,4 +1,4 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($) {
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-control.min.js

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

4 changes: 2 additions & 2 deletions dist/jquery.jcarousel-core.js
@@ -1,12 +1,12 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($) {
'use strict';

var jCarousel = $.jCarousel = {};

jCarousel.version = '0.3.7';
jCarousel.version = '0.3.8';

var rRelativeTarget = /^([+\-]=)?(.+)$/;

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.jcarousel-core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-pagination.js
@@ -1,4 +1,4 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($) {
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-pagination.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 dist/jquery.jcarousel-scrollintoview.js
@@ -1,4 +1,4 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($) {
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-scrollintoview.min.js

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

9 changes: 5 additions & 4 deletions dist/jquery.jcarousel.js
@@ -1,12 +1,12 @@
/*! jCarousel - v0.3.7 - 2018-02-17
/*! jCarousel - v0.3.8 - 2018-05-31
* http://sorgalla.com/jcarousel/
* Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
(function($) {
'use strict';

var jCarousel = $.jCarousel = {};

jCarousel.version = '0.3.7';
jCarousel.version = '0.3.8';

var rRelativeTarget = /^([+\-]=)?(.+)$/;

Expand Down Expand Up @@ -1400,7 +1400,8 @@
_options: {
target: '+=1',
interval: 3000,
autostart: true
autostart: true,
method: 'scroll'
},
_timer: null,
_started: false,
Expand Down Expand Up @@ -1452,7 +1453,7 @@
.one('jcarousel:animateend', this.onAnimateEnd);

this._timer = setTimeout($.proxy(function() {
this.carousel().jcarousel('scroll', this.options('target'));
this.carousel().jcarousel(this.options('method'), this.options('target'));
}, this), this.options('interval'));

return this;
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.jcarousel.min.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions docs/plugins/autoscroll/reference/configuration.md
Expand Up @@ -6,6 +6,7 @@ The plugin accepts the following options:
* [target](#target)
* [interval](#interval)
* [autostart](#autostart)
* [method](#method)

Options can be set either on [initialization](installation.md#setup) or at
[runtime](api.md#reload).
Expand Down Expand Up @@ -67,3 +68,21 @@ $('.jcarousel').jcarouselAutoscroll({
### Default

`true`


method
------

The method to call on the carousel.

### Example

```javascript
$('.jcarousel').jcarouselAutoscroll({
method: 'scrollIntoView'
});
```

### Default

`scroll`
2 changes: 1 addition & 1 deletion package-lock.json

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
Expand Up @@ -2,7 +2,7 @@
"name": "jcarousel",
"title": "jCarousel",
"description": "Riding carousels with jQuery",
"version": "0.3.7",
"version": "0.3.8",
"homepage": "http://sorgalla.com/jcarousel/",
"author": {
"name": "Jan Sorgalla",
Expand Down
5 changes: 3 additions & 2 deletions src/autoscroll.js
Expand Up @@ -30,7 +30,8 @@
_options: {
target: '+=1',
interval: 3000,
autostart: true
autostart: true,
method: 'scroll'
},
_timer: null,
_started: false,
Expand Down Expand Up @@ -82,7 +83,7 @@
.one('jcarousel:animateend', this.onAnimateEnd);

this._timer = setTimeout($.proxy(function() {
this.carousel().jcarousel('scroll', this.options('target'));
this.carousel().jcarousel(this.options('method'), this.options('target'));
}, this), this.options('interval'));

return this;
Expand Down

0 comments on commit e9d7d31

Please sign in to comment.