at this address:
http://www.kickproduction.it/grupporem/?category=99&prezzo=&prezzo_anywhere=&asw_search=true
I want hide map defalut, and display only if click on "Visualizza i risultati sulla Mappa"
The SlideUp/Down works, but the map doens't load correctly.
(chrome: not center map / firefox: blank map)
The map is a <?php echo GeoMashup::map( 'map_content=contextual' ); ?>, that works in a results page.
Anyone could help me?
this is my JS code:
$("#divToggle").slideUp();
$('#aTag').live('click', function() {
var divT = $('#divToggle');
if (divT.is(":hidden")) {
divT.slideDown("slow");
$(this).text('Nascondi Mappa');
}
else {
divT.slideUp('fast');
$(this).text('Vedi Risultati sulla Mappa');
}
});
Dylan Kuhn answers:
In general google maps will not load properly when hidden. You can load them offscreen instead. I'm not sure if the frame load event is late enough, but you could try
$( '#divToggle .gm-map iframe' ).load( function() {
$( '#divToggle' ).slideUp();
} );
Manlio Ma comments:
Thanx DYlan, your code works !
Bu is impossible to hide ? And if I use a tab jquery would be the same problem ..cause will be no_display tab?
Dylan Kuhn comments:
Right - anything using hide(), slideUp(), toggle(), etc. ends up hidden. Here's some code where I put things way above the viewport with top at -9999px instead of hiding, and there they render correctly: https://groups.google.com/forum/#!topic/wordpress-geo-mashup-plugin/orORRG892yw/discussion
Michael Caputo answers:
It looks like the map is loading properly when hidden..
I would try adding a div around the <div class="legenda fl"> div
Manlio Ma comments:
nothing new :(