Skip to content

Commit

Permalink
Fixed typo and added outer height/width because this caused skewed ti…
Browse files Browse the repository at this point in the history
…lting.
  • Loading branch information
gijsroge committed Mar 23, 2017
1 parent 6910fdc commit 67c5389
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .npmignore
@@ -1 +0,0 @@
node_modules/
6 changes: 3 additions & 3 deletions dest/tilt.jquery.js

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

2 changes: 1 addition & 1 deletion dest/tilt.jquery.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dest/tilt.jquery.min.js

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

6 changes: 3 additions & 3 deletions src/tilt.jquery.js
Expand Up @@ -45,7 +45,7 @@
};

/**
* Return the x,y position of the muose on the tilt element
* Return the x,y position of the mouse on the tilt element
* @returns {{x: *, y: *}}
*/
const getMousePositions = function(event) {
Expand Down Expand Up @@ -84,8 +84,8 @@
* @returns {{x: tilt value, y: tilt value}}
*/
const getValues = function() {
const width = $(this).width();
const height = $(this).height();
const width = $(this).outerWidth();
const height = $(this).outerHeight();
const left = $(this).offset().left;
const top = $(this).offset().top;
const percentageX = (this.mousePositions.x - left) / width;
Expand Down

0 comments on commit 67c5389

Please sign in to comment.