SHARE
TWEET

Untitled

a guest Apr 27th, 2012 1,267 Never
  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>
RAW Paste Data
Top