Skip to content

Commit

Permalink
Use the font-size of the element if the font-size of the parent is 0 …
Browse files Browse the repository at this point in the history
…and use 16 if both are 0 (applies when deltaMode is 1).
  • Loading branch information
brandonaaron committed Jul 10, 2014
1 parent aa6e7f4 commit 669312f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Mouse Wheel ChangeLog

## 3.1.12

* Fix possible 0 value for line height when in delta mode 1

## 3.1.11

* Fix version number for package managers...
Expand Down
5 changes: 3 additions & 2 deletions jquery.mousewheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@
},

getLineHeight: function(elem) {
var $parent = $(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
var $elem = $(elem),
$parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
if (!$parent.length) {
$parent = $('body');
}
return parseInt($parent.css('fontSize'), 10);
return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
},

getPageHeight: function(elem) {
Expand Down

0 comments on commit 669312f

Please sign in to comment.