Map on hidden Tab – Solution
-
So, I was using a tab in Visual Composer, The tabs are
<li>
tags with a link inside, and only the link has an ID. How to attach javascript to the li so when clicked it causes the map to appear instead of being grey, and then remove the javascript from the li? Here you go:<script> jQuery(document).ready(function($){ var $mapclickparent = $('#ab759e6c-edb7-8').parent(); var mapClickHandler = function () { $($mapclickparent).unbind('click', mapClickHandler); var evt = document.createEvent('UIEvents'); evt.initUIEvent('resize', true, false, window, 0); window.dispatchEvent(evt); }; $($mapclickparent).bind('click', mapClickHandler); }); </script>
Where you can see the ID number of the link. No need to resize the map, no need for a map ID, no need to hack the plugin.
Trevor (freelance support agent for plugins and themes).
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Map on hidden Tab – Solution’ is closed to new replies.