I'm trying to scroll down to the bottom of the page when a new message is received or sent, I have everything set up and it's working fine on my laptop but when I try accessing my website on a mobile device the scroll event is not working.
Well I have used both of jQuery scroll, and pure javascript scroll but none of them worked on the mobile device
Here are all the functions that I used which I found all across the internet:
//first method
window.scrollTo(0,document.body.scrollHeight);
//second method
$("html,body").animate({
scrollTop: $(document).height()
}, "slow");
//third method
$('my-messages-container').animate({ scrollTop : $(document).height()+1000000 });
well, the code is working fine when I use the developer tools mobile simulation. but when I try it on a real mobile device it doesn't work.