title: How to scroll to the bottom of the page in a mobile device
body: <p>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.</p>
  
  <p>Well I have used both of jQuery scroll, and pure javascript scroll but none of them worked on the mobile device </p>
  
  <p>Here are all the functions that I used which I found all across the internet:</p>
  
  <pre><code>//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 });
  
  </code></pre>
  
  <p>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.</p>