jamesflorentino / nanoScrollerJS

A jQuery plugin that offers a simplistic way of implementing Lion OS scrollbars.
http://jamesflorentino.github.com/nanoScrollerJS/
MIT License
2.69k stars 502 forks source link

Wrong padding-right added in Firefox OSx #242

Closed agustinrodriguez closed 10 years ago

agustinrodriguez commented 10 years ago

I tested in Firefox using OSx with Retina Display. The nanoscroller adds a big value of padding-right to the element container.

Reading the code I figured out the following: When this condition is true: BROWSER_SCROLLBAR_WIDTH === 0 && isFFWithBuggyScrollbar(), you're adding a padding-right 14 to the computed padding-right. I think that there is an issue getting the computed style. You are trying to remove the "px" characters from the computed with a replace: .replace(/\D+/g, '') That's fine when the computed padding is "20px", but it would be "20.50px", then with your replace the computed value will be "2050", a wrong value. I think the "replace" would be: .replace(/[^0-9.]/g, '')

kristerkari commented 10 years ago

Thanks for debugging this!