Skip to content

Commit

Permalink
fix: use document viewport size (#78)
Browse files Browse the repository at this point in the history
Fixes issue where scrollbars are visible but not accounted for in the measured width.

Closes #75.
  • Loading branch information
edwardhorsford authored and francoischalifour committed Nov 4, 2018
1 parent 3246bbb commit 9a06f9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/medium-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ const mediumZoom = (selector, options = {}) => {
const open = ({ target } = {}) => {
const _animate = () => {
let container = {
width: window.innerWidth,
height: window.innerHeight,
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight,
left: 0,
top: 0,
right: 0,
Expand Down

0 comments on commit 9a06f9b

Please sign in to comment.