Loading dialog position

Loading dialog position

Hello all,

I am testing new mobile app project and fetching data from the server by getJSON(); and the list take some time to be loaded. what i want is loading dialog to appear in the center of the list container. I tried $.mobile.loading but it appears in the middle of the page not inside the list container !

here is my code
  1.  <body>
  2.             
  3.         <div id="home-page" data-role="page">
  4.             <div id="home-header" data-role="header">
  5.                 <h1><i class="icon-home"></i> Header</h1>
  6.             </div><!-- /#header -->
  7.             
  8.             <div id="home-content" data-role="content">
  9.             <ul id="category_list" data-filter="true" data-theme= "a" data-inset="true">   </ul>
  10.             </div>
  11.             
  12.             
  13.             <div id="footer" data-role="footer">
  14.                 <h1><i class="icon-coffee"></i> 2014 - Touch Marketing & Advertising</h1>
  15.             </div><!-- /#footer -->
  16.         </div>

  17.     </body>
      here is the script

  1. $.ajax({
  2. url: 'http://api.ihackernews.com/page?count=2&format=jsonp',
  3. crossDomain: true,
  4. dataType:'jsonp',
  5. type:'GET',
  6. cache: false,
  7. success: function(data){
  8. var loading = $.mobile.loading('show');
  9. $('#category_list').append(loading);
  10. $(data.items).each(function(index, val) {
  11.                     
  12. category = '<li><a href="posts.html" onclick="postList('+val.id+', '+val.post_count+')"> \
  13. '+val.title+' \
  14. </a></li>';
  15. $('#category_list').append(category);

  16.                 });
  17. }
  18. });