avianey / jqDoubleScroll

A jQuery plugin that duplicate the bottom scrollbar of an element to its top
73 stars 65 forks source link

Scrollbar appears when it shouldn't due to rounding error. #15

Closed JoshBour closed 3 years ago

JoshBour commented 4 years ago

The scrollWidth property always rounds up to an integer. There are some instances where $self.width() would be something like 1058.10 and $self.get(0).scrollWidth would round up to 1059, causing the condition to fail and so the scrollbar would appear when it shouldn't. By rounding up $self.width() we avoid this error.

abraaoz commented 3 years ago

Thank you @JoshBour , apparently @avianey passed away and therefore did not approve this excellent pull request. R.I.P.