I have slight problem with Google maps included in simple jQuery Tabs.
Below I pasted the code:
jQuery:
$(document).ready(function() {
If you are still struggling to get this right like I was, Try this.
var hasLoadedMap = false;
$( "#tabs" ).tabs({
activate: function( event, ui ) {
//console.log(ui.newTab.context.id);
if(!hasLoadedMap && ui.newTab.context.id == 'ui-id-4') { //my map tab has index 4. This will avoid initialization for other tabs
console.log(ui.newTab.context.id);
initialize(); //google map initialization code
hasLoadedMap = true;
}
}
});
I have adapted the other answers above into something more current.