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

How to get current scrollTop/scrollBottom offset? #236

Open rtnpro opened 10 years ago

rtnpro commented 10 years ago

I see no way to retrieve the current scrollTop and scrollBottom values of the nanoScroller empowered scrollable content. It'd be great to have these values in order to retain scroll position when loading more data on scroll up.

IPWright83 commented 10 years ago

I'd also like to know how to find these. I attempting to allow drag/drop scrolling on the content area, and want to trigger an update scroll with nanoScroller

eTorAken commented 9 years ago

I don't know if that could help, but maybee you could try to retrieve data everytime the update event is triggered:

var position, maximum, direction;
$('.nano').on('update', function (e, data) {
  position = data.position;
  maximum = data.maximum;
  direction = data.direction
});

This will give you enough informations to retain current scroll position. The you can use @miljan-aleksic solution at issue#137 to get back to this position after your further data has been loaded.