Skip to content

Commit

Permalink
fix threshold bug
Browse files Browse the repository at this point in the history
  • Loading branch information
callmecavs committed Jan 25, 2016
1 parent d9be995 commit 288fcc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/layzr.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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "layzr.js",
"version": "2.0.0",
"version": "2.0.1",
"description": "A small, fast, and modern library for lazy loading images.",
"homepage": "http://callmecavs.github.io/layzr.js/",
"main": "dist/layzr.min.js",
Expand Down
2 changes: 1 addition & 1 deletion src/layzr.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default (options = {}) => {
const nodeTop = getOffset(node)
const nodeBot = nodeTop + node.offsetHeight

const offset = (settings.threshold * 100) / windowHeight
const offset = (settings.threshold / 100) * windowHeight

return nodeBot >= viewTop - offset
&& nodeTop <= viewBot + offset
Expand Down

0 comments on commit 288fcc2

Please sign in to comment.