Reputation: 33
I am using maplace plugin to display Google Map in jQuery tabs when you let off the map (second tab), the map can not load completely.
Upvotes: 1
Views: 213
Reputation: 371
The solution is to move the new Maplace out of the document load and into the tab click event.
Working fiddle: http://jsfiddle.net/6xwwv1pg/
Reference code
$('[data-tab]').on('click', function (e) {
$(this)
.addClass('active')
.siblings('[data-tab]')
.removeClass('active')
.siblings('[data-content=' + $(this).data('tab') + ']')
.addClass('active')
.siblings('[data-content]')
.removeClass('active');
e.preventDefault();
new Maplace({
locations: LocsA1,
map_div: '#gmap-dropdown',
controls_title: 'Choose a location:'
}).Load();
});
Upvotes: 2
Reputation: 4636
You need to put your map div
:
<div class="map" id="gmap-dropdown"></div>
outside of your tabs
div, as well as some Jquery logic:
Upvotes: 2