Reply To: infoWindow wont dissapear when switching tabs

Home Forums MapPress Support infoWindow wont dissapear when switching tabs Reply To: infoWindow wont dissapear when switching tabs

#11890
Chris
Keymaster

Hi,

The problem is that the infobox doesn’t know to close when another tab clicked.

The easiest thing is to just use the infowindow instead.  But if you’re familiar with javascript and editing your template files, something like the code below may work for you.

You would need to add this code to the page template where the map is displayed.

It should close the infowindow for the first map (‘mapp0’) on the screen whenever any tab is clicked (the ‘tabsshow’ event).  You can change the map name using the ‘name’ parameter in the shortcode.  You can also adjust the javascript to trigger only for certain tabs:

jQuery('body').on('tabsshow', function(e, ui) {
  if (ui && ui.panel) {    
    mapp0.closeInfoWindow();  
  }
}