Trouble with putting google maps in a collapsible set in jquery mobile.

Trouble with putting google maps in a collapsible set in jquery mobile.

Hello

I'm trying to put a google map in a collapsible set in a jquery mobile site I'm working on. The map skips when moved in the div but outside the div it behaves normally. Does anyone have a solution for this problem?

The code looks like this and it's inside a collapsible-set:

  1. <div data-role="collapsible" data-collapsed="true">
  2.         <h3>
  3.             Navigation</h3>
  4.         <div data-role="content" id="map_canvas" >
  5.             <script type="text/javascript">

  6.                 function initializeMap() {
  7.                     var latlng = new google.maps.LatLng(64.135338, -21.89521);
  8.                     var options = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.SATELLITE
  9.                     };
  10.                     var map = new google.maps.Map(document.getElementById("map_canvas"), options);
  11.                     google.maps.event.trigger(map, 'resize');
  12.                     var marker = new google.maps.Marker({
  13.                         position: latlng,
  14.                         map: map,
  15.                         title: "Hello World!"
  16.                     });
  17.                     google.maps.event.trigger(map, 'resize');

  18.                 };

  19.                 $(function () {
  20.                     initializeMap();


  21.                 });  

  22.     
  23.             </script>
  24.         </div>
  25.     </div>