daily pastebin goal
74%
SHARE
TWEET

Elementor tabs with maps by Fla-shop.com

a guest Feb 15th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setTimeout (function () { map.reloadMap(); }, 10);
  2.  
  3. var parents = jQuery('#'+containerId).parentsUntil('.elementor-tab-content');
  4. var tabContainer = null;
  5. if (parents.length) {
  6.     var last = parents[parents.length - 1];
  7.     if (jQuery(last).parent() && last != document.firstElementChild) {
  8.         tabContainer = jQuery(last).parent()[0];
  9.     }
  10. }
  11.  
  12. var reloadDone = false;
  13.  
  14. if (! tabContainer)
  15.     return;
  16. tabContainer = jQuery(tabContainer);
  17. var tabId = tabContainer.data('tab');
  18.  
  19. var clickCallback = function () {
  20.     if (reloadDone) return;
  21.     setTimeout(function () {
  22.         map.reloadMap();
  23.         reloadDone = true;
  24.     }, 10);
  25. };
  26.  
  27. var  tab = tabContainer.parentsUntil('.elementor-widget-container').find('[role=tab][data-tab='+tabId+']');
  28. tab.on('click', clickCallback);
  29. jQuery(window).resize(function () { reloadDone = false; });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top