Postpone google maps initialisation until after bootstrap tab is shown

前端 未结 7 1393
-上瘾入骨i
-上瘾入骨i 2020-12-06 22:25

I\'ve researched a lot and it seems like a lot of people have had the same issue as me here, but i cant figure out how to fix it.

Basically i\'m initializing a googl

7条回答
  •  不思量自难忘°
    2020-12-06 23:10

    You should be able to attach a handler to the Bootstrap tab show event..

    $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        initialize();
    });
    

    Working demo: http://bootply.com/102241

提交回复
热议问题