Advertisement
Guest User

Untitled

a guest
Apr 27th, 2012
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement