Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{scroll: 'bottom'} doesn't work every time. #306

Open
oguzgelal opened this issue Jun 29, 2015 · 8 comments
Open

{scroll: 'bottom'} doesn't work every time. #306

oguzgelal opened this issue Jun 29, 2015 · 8 comments

Comments

@oguzgelal
Copy link

Hello,

When new contents are added (after each template is rendered and added into the DOM), I call $(".nano").nanoScroller({ scroll: 'bottom' });
but for some reason, calling that method doesn't scroll to the bottom after some time.

@kristerkari
Copy link
Collaborator

Would you be able to put together some kind of demo of this happening?

@oguzgelal
Copy link
Author

https://socialsurf.io/frame/oguzgelal.com

I don't know if I could reproduce the same issue on jsFiddle but have a look at this page: When new messages appear, sometimes (on mobile devices especially) it fails to scroll to the bottom. The code is being executed after every message box is rendered and on keyword (when you type to the message box, the code should execute). About mobile, I do use the overthrow.js.

Thanks for the answer,
Oguz

@oguzgelal
Copy link
Author

PROBLEM SOLVED! (I think)

Apparently, I was running the initialisation code before the DOM was created. Weird but no errors were thrown into the console. The confusion is because the Meteor JS framework that I'm currently using. The problem should be solved now. I'll close this issue and if it happens again I'll re-open it.

Great library by the way, thanks for all the fish 😄

@oguzgelal
Copy link
Author

Nope, the problem still occurs :(

@oguzgelal oguzgelal reopened this Jun 30, 2015
@kristerkari
Copy link
Collaborator

@oguzgelal Hmm I don't really know what's wrong, but ine thing that you can try is to call nanoScroller once before calling it with the scroll command:

$(".nano").nanoScroller();
$(".nano").nanoScroller({ scroll: 'bottom' });

@oguzgelal
Copy link
Author

I already do that, but doesn't seem to work :(

@rockymontana
Copy link

Same for me...
I use dynamic content to fill the div, and when I render the content I call the nanoslider-init...
But it doesn't scroll...

@csimpi
Copy link

csimpi commented May 9, 2017

Here it works, the content is scrolled to very bottom, BUT the scrollbar remain on the top. Very strange. If I scroll down with mouse wheel, the scrollbar jumps to the bottom right away. This should be a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants