Use the font-size of the element if the font-size of the parent is 0 and use 16 if both are 0 (applies when deltaMode is 1).

This commit is contained in:
Brandon Aaron
2014-07-10 11:22:35 -04:00
parent aa6e7f4087
commit 669312f499
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -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...
+3 -2
View File
@@ -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) {