Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 27th, 2012  |  syntax: None  |  size: 0.54 KB  |  views: 1,103  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery Mobile - scroll to specific div on pageload
  2. $.mobile.silentScroll($("#myElementId").offset().top);
  3.        
  4. $('[data-role=page]').bind("pageshow", function() {
  5.     $.mobile.silentScroll($("#myElementId").offset().top);
  6. });
  7.        
  8. $('[data-role=page]').bind("pageshow", function() {
  9.     setTimeout(function(){$.mobile.silentScroll($("#myElementId").offset().top);},100);
  10. });
  11.        
  12. <script src="[jQuery Core]"></script>
  13. <script>
  14. $(document).bind("mobileinit", function(){
  15.     minScrollBack = 90000;
  16. });
  17. </script>
  18. <script src="[jQuery Mobile]"></script>