We have been running into this issue for a bunch of website that have no desire to show the Google map first in the sidebar. In fact, a better portion of the community wants the ad details in the sidebar!
Sometimes developing websites is funny. You can spend hours of time in research and testing to come up with only 3-4 lines of code which fixes the problem. Non-developers probably wonder “Why did it take them so long to come up with that?!” What you don’t see is the 500-600 other variations of the code we had to try before we got something that works. So here is about 4 hours of research and development that’s broken down to a mere few lines of code…
Place this code at the bottom of your custom sidebar-ad.php file.
<script type="text/javascript"> jQuery('.tabprice ul.tabnavig li a').click(function() { if(jQuery(this).attr('href') == '#priceblock1') { //the element has to be visible on the page for google maps to render properly jQuery('#priceblock1').show(); //rebuild the google map canvas to the proper size google.maps.event.trigger(map, 'resize'); //ClassiPress javascript function to build map at address codeAddress(); } }); </script>
© Copyright 2024 Sethmatics Websites All Rights Reserved.
Recent Comments