google maps in jquery mobile

前端 未结 4 1550
栀梦
栀梦 2020-12-28 20:06

When showing a google map in jquery mobile it appears (after reading the forums) that code like the following is required:

4条回答
  •  爱一瞬间的悲伤
    2020-12-28 20:31

    Quick and dirty fix that worked for me:

    $('[data-role=content]')
      .height(
        $(window).height() - 
        (5 + $('[data-role=header]').last().height() 
        + $('[data-role=footer]').last().height())
      );
    // tell google to resize the map
    google.maps.event.trigger(map, 'resize');
    

提交回复
热议问题