Skip to content

Commit

Permalink
v4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zengabor committed Feb 28, 2018
1 parent 078918c commit b8edb6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenscroll",
"version": "4.0.0",
"version": "4.0.1",
"description": "A module to smooth-scroll web pages and scrollable elements (like DIVs)",
"main": "zenscroll.js",
"files": ["zenscroll.js", "zenscroll-min.js"],
Expand Down
2 changes: 1 addition & 1 deletion zenscroll-min.js

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

7 changes: 4 additions & 3 deletions zenscroll.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Zenscroll 4.0.0
* Zenscroll 4.0.1
* https://github.com/zengabor/zenscroll/
*
* Copyright 2015–2017 Gabor Lenard
* Copyright 2015–2018 Gabor Lenard
*
* This is free and unencumbered software released into the public domain.
*
Expand Down Expand Up @@ -58,7 +58,7 @@

// Detect if the browser already supports native smooth scrolling (e.g., Firefox 36+ and Chrome 49+) and it is enabled:
var isNativeSmoothScrollEnabledOn = function (elem) {
return ("getComputedStyle" in window) &&
return elem && "getComputedStyle" in window &&
window.getComputedStyle(elem)["scroll-behavior"] === "smooth"
}

Expand Down Expand Up @@ -177,6 +177,7 @@
* @param {elem} The element.
* @param {duration} Optionally the duration of the scroll operation.
* @param {offset} Optionally the offset of the top of the element from the center of the screen.
* A value of 0 is ignored.
* @param {onDone} An optional callback function to be invoked once the scroll finished.
*/
var scrollToCenterOf = function (elem, duration, offset, onDone) {
Expand Down

0 comments on commit b8edb6c

Please sign in to comment.