1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-09-18 00:42:03 +02:00

Compare commits

...

3 Commits
1.3.1 ... 1.3.3

Author SHA1 Message Date
Antonio Laguna
cfd1f74b9b 1.3.3 2017-07-29 13:20:59 +02:00
Antonio Laguna
7bcafd9f7c Fixing scrollable container in run time 2017-07-29 13:20:03 +02:00
Antonio Laguna
71121169f0 1.3.2 2017-07-28 11:57:47 +02:00
2 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
{
"name": "webslides",
"version": "1.3.1",
"version": "1.3.3",
"description": "Making HTML presentations easy",
"main": "index.js",
"main": "static/js/webslides.js",
"repository": {
"type": "git",
"url": "git+https://github.com/webslides/webslides.git"

View File

@@ -1,6 +1,6 @@
import Easings from './easing';
const SCROLLABLE_CONTAINER = document.getElementById('webslides');
let SCROLLABLE_CONTAINER = document.getElementById('webslides');
/**
* Smoothly scrolls to a given Y position using Easing.Swing. It'll run a
@@ -10,6 +10,8 @@ const SCROLLABLE_CONTAINER = document.getElementById('webslides');
* @param {function} cb Callback function to call upon completion.
*/
export default function scrollTo(y, duration = 500, cb = () => {}) {
SCROLLABLE_CONTAINER = SCROLLABLE_CONTAINER
|| document.getElementById('webslides');
const delta = y - SCROLLABLE_CONTAINER.scrollTop;
const startLocation = SCROLLABLE_CONTAINER.scrollTop;
const increment = 16;