Skip to content

Commit

Permalink
3.0.1
Browse files Browse the repository at this point in the history
Improved detection of the smooth-scroll setting in the browser
  • Loading branch information
zengabor committed Feb 17, 2016
1 parent 4cb21a5 commit a1be3dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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.

5 changes: 3 additions & 2 deletions zenscroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Zenscroll 3.0.0
* Zenscroll 3.0.1
* https://github.com/zengabor/zenscroll/
*
* Copyright 2015–2016 Gabor Lenard
Expand Down Expand Up @@ -60,7 +60,8 @@

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

var getScrollTop = function () {
Expand Down

0 comments on commit a1be3dc

Please sign in to comment.