Skip to content

Commit caf84dc

Browse files
committed
Merge pull request rochal#7 from robink/master
bar.css('top') instead of bar.position().top
2 parents 2537c81 + 09400fc commit caf84dc

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

slimScroll.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
33
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
44
*
5-
* Version: 0.4.0
5+
* Version: 0.4.1
66
*
77
*/
88
(function($) {
@@ -179,7 +179,7 @@
179179
if (isWheel)
180180
{
181181
// move bar with mouse wheel
182-
delta = bar.position().top + y * wheelStep;
182+
delta = parseInt( bar.css('top') ) + y * wheelStep;
183183

184184
// move bar, make sure it doesn't go out
185185
delta = Math.max(delta, 0);
@@ -191,7 +191,7 @@
191191
}
192192

193193
// calculate actual scroll amount
194-
var percentScroll = parseInt(bar.position().top) / (me.outerHeight() - bar.outerHeight());
194+
var percentScroll = parseInt( bar.css('top') ) / (me.outerHeight() - bar.outerHeight());
195195
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
196196

197197
if (isJump)

slimScroll.min.js

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)