Skip to content
This repository was archived by the owner on Jul 3, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/scrollsnap-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@
// when using %, one snap is the length of element height / 100 * value
return getHeight(obj) / 100 * declaration.value;
} else {
// when using px, one snap is the length of element height / value
return getHeight(obj) / declaration.value;
// when using px, one snap is the value
return declaration.value;
}

return 0;
Expand All @@ -496,8 +496,8 @@
// when using %, one snap is the length of element width / 100 * value
return getWidth(obj) / 100 * declaration.value;
} else {
// when using px, one snap is the length of element width / value
return getWidth(obj) / declaration.value;
// when using px, one snap is the value
return declaration.value;
}

return 0;
Expand Down