Last active
April 23, 2018 06:44
-
-
Save bigdigital/6b36860227a54664311e545f2f5e30c4 to your computer and use it in GitHub Desktop.
The7 Fix for messed content in tabs, accordion and toogle elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
setTimeout(function(){ | |
$(window).trigger('resize'); | |
}, 500); | |
function dtResize() { | |
var elements = []; | |
elements['accord']= jQuery(".wpb_accordion_header"), | |
elements['ult_tab'] = $(".ult_tabs > ul >li"), | |
elements['theme_tab'] = $(".wpb_tour_tabs_wrapper > ul >li"), | |
elements['togg'] = $(".wpb_toggle"); | |
function resizeme() { | |
$(window).trigger('resize'); | |
if (typeof google !== 'undefined') google.maps.event.trigger(map, 'resize'); | |
//add "class="gmaps" class to the google maps iframe to get properly scaled map int the tab see https://www.screencast.com/t/RtkfYhgoydXV | |
jQuery( '.gmaps' ).find('iframe').attr( 'src', function ( i, val ) { return val; }); | |
}; | |
for (var key in elements) { | |
if (elements[key].length) { | |
resizeme(); | |
elements[key].on("click",function() { | |
resizeme(); | |
}); | |
} | |
} | |
} | |
dtResize();}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment