Skip to content

Commit

Permalink
Fix issue where using a number for the offset wouldn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffshaver committed Jan 11, 2014
1 parent fd38e64 commit efd2b6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vh-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ var vhmin = function() {
var vhminOffset = item.getAttribute('data-vhmin-offset'),
offset;
if (!isNaN(parseInt(vhminOffset, 10))) {
offset = vhminOffset;
offset = parseInt(vhminOffset, 10);
} else if (!vhminOffset) {
offset = 0;
} else if (isNaN(parseInt(vhminOffset, 10))) {
offset = document.querySelector(vhminOffset).offsetHeight;
}
}
this.elements.push({
element: item,
offset: offset
Expand Down Expand Up @@ -52,4 +52,4 @@ var vhmin = function() {
}
}
}
}();
}();

0 comments on commit efd2b6e

Please sign in to comment.