Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit cf6d46f

Browse files
committed
v0.6.7
1 parent 811b4cf commit cf6d46f

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,11 @@ The callback has one argument which returns the data object:
525525
index: // the current page index
526526
scrolled: // the current scroll offset
527527
max: // the maximum scroll amount possible
528+
percent: // the scroll position as a percentage of the maximum scroll (v0.6.7 and above)
528529
}
529530
```
530531

531-
You can calculate the progress of the instance from the data:
532-
```javascript
533-
const percentage = data.scrolled / data.max * 100;
534-
```
535-
536-
This can be helpful when adding progress indicators (see [Adding Progress Bars](https://mobius1.github.io/Pageable/progress.html)).
532+
The `percent` property can be helpful when adding progress indicators (see [Adding Progress Bars](https://mobius1.github.io/Pageable/progress.html)).
537533

538534
### Examples
539535
```javascript

dist/pageable.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
55
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
66
7-
Version: 0.6.6
7+
Version: 0.6.7
88
99
*/
1010
.pg-pips{position:fixed;z-index:1000}.pg-pips ul{margin:0;padding:0}.pg-pips ul li{width:14px;height:14px;margin:7px;position:relative}.pg-pips ul li:hover a{width:10px;height:10px;margin:-5px 0 0 -5px}.pg-pips ul li a{display:block;cursor:pointer;text-decoration:none;border-radius:50%;position:absolute;z-index:1;height:4px;width:4px;border:0;background:#fff;left:50%;top:50%;margin:-2px 0 0 -2px}.pg-pips ul li a.active,.pg-pips ul li:hover a.active{position:absolute;height:14px;width:14px;margin:-7px 0 0 -7px;border-radius:100%}.pg-vertical .pg-pips{right:10px;top:50%;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pg-vertical .pg-pips li{display:block}.pg-horizontal .pg-pips{bottom:10px;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.pg-horizontal .pg-pips li{display:inline-block}

dist/pageable.min.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pageable",
3-
"version": "0.6.6",
3+
"version": "0.6.7",
44
"description": "Create full page scrolling web pages. No jQuery.",
55
"main": "dist/pageable.min.js",
66
"scripts": {

src/pageable.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
55
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
66
7-
Version: 0.6.6
7+
Version: 0.6.7
88
99
*/
1010
(function(root, factory) {
@@ -102,7 +102,7 @@
102102
};
103103

104104
/**
105-
* Pageable 0.6.6
105+
* Pageable 0.6.7
106106
*
107107
* https://github.com/Mobius1/Pageable
108108
* Released under the MIT license
@@ -933,10 +933,14 @@
933933
* @return {Object}
934934
*/
935935
Pageable.prototype._getData = function() {
936+
const scrolled = this.config.infinite ? this.scrollPosition - this.data.window[this.size[this.axis]] : this.scrollPosition;
937+
const max = this.config.infinite ? this.scrollSize - this.data.window[this.size[this.axis]] * 2 : this.scrollSize;
938+
936939
return {
937940
index: this.index,
938-
scrolled: this.config.infinite ? this.scrollPosition - this.data.window[this.size[this.axis]] : this.scrollPosition,
939-
max: this.config.infinite ? this.scrollSize - this.data.window[this.size[this.axis]] * 2 : this.scrollSize
941+
percent: scrolled / max * 100,
942+
scrolled: scrolled,
943+
max: max
940944
};
941945
};
942946

src/pageable.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
55
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
66
7-
Version: 0.6.6
7+
Version: 0.6.7
88
99
*/
1010
$pip-color: #fff;

0 commit comments

Comments
 (0)