Jquery mobile scroll to top of page on page load

Jquery mobile scroll to top of page on page load

Hi everyone

I have done extensive research on creating a solution for my problem, all forum posts just dont answer my question.

Im using an iPhone 5 to test my web app. Everytime  i load a new page dynamically from my CMS i find that if i scroll to the bottom BEFORE the page fully loads then i get scrolled to the top of the page when the page has completed loading. This is highly unwanted as i could only imagine that when my listviews are long this would be highly annoying to any user thats half way down the list.

Please could somebody assist me? I have tried the following codes

  1. <script language="javascript">
  2.      $(document).ready(function() {
  3.         $(".dropdown dt a").click(function(event) {
  4.         event.preventDefault();
  5.             $(".dropdown dd ul").toggle('slow');
  6.         });          
  7.         $(".dropdown dd ul li a").click(function(event) {
  8.         event.preventDefault();
  9.             $(".dropdown dd ul").hide();
  10.         });
  11.     });
  12. </script>


I also tried this code

  1. <script>
  2.   $(function() { 
  3.     $.mobile.silentScroll (0);
  4.   });
  5. </script>

Any help would be greatly appreciated.

Kind regards