Advertisement
Guest User

Untitled

a guest
Feb 15th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('#loadingPage').bind('pageinit', function(event) {
  2.     $('#loadingPage').append("<img id='load-img' src='../img/logo_big.png' style='display:none' />");
  3.     $('#load-img').load(function() {
  4.         $('#load-img').width($(window).width() * 0.8);
  5.         $('#load-img').css('margin-left', ($(window).width() - $('#load-img').width()) / 2);
  6.         $('#load-img').css('margin-top', ($(window).height() - $('#load-img').height()) / 2);
  7.         $('#load-img').show();
  8.         setTimeout(function() {
  9.             $.mobile.changePage("menu.html", {
  10.                 transition : "slideup"
  11.             });
  12.         }, 1000)
  13.     })
  14. });
  15. $('#menuPage').live('click', function(){
  16.     alert('aa');
  17. })
  18. $('#menuPage').live('pagecreate', function(event) {
  19.     alert('bb');
  20.     //resize the menu
  21.     var nbImg = $('img').length - 1;
  22.     $("img:eq(" + nbImg + ")").load(function() {
  23.         if ($('#menu').height() < $(window).height()) {
  24.             var margin = $(window).height() - ($('#menu').height() - $(window).height() * 0.3 );
  25.             margin = margin / 2;
  26.             if (margin > 0) {
  27.                 $('#menu .menu_content_first').css('margin-top', margin);
  28.             }
  29.         }
  30.        
  31.         //settings size
  32.         $('#menu #settings').css('bottom',$('#menu').height()-$(window).height()+'px');
  33.     });
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement