Reputation: 5271
Acutally i've asked the same question
I put Google Map inside a div, and made a slideToggle onto the div. the Google Map doesn't display correctly. Google map API doesn't display correctly jQuery slideToggle
but I think this question is closer to the answer, I put everything in slideToggle callback;
$this.next('.hide').slideToggle(function initialize(){
}
Please view the code on jsfiddle
If you open all 3 maps down, and then drag the map a bit and "click" to make it slidedown, you will see the other two are refreshed as well. The issue at the moment is that, all 3 maps refresh together not just itself when slideup or down.
If someone could help? Thanks
Upvotes: 1
Views: 491
Reputation: 2368
There wasn't any reference to the element triggering the slideToggle
function in your code, so it was forced to execute the same thing every time you run the function.
This should work: http://jsfiddle.net/aA9Vq/1/
The major change I did was to change the map ID depending of the context (this
) of the slideToggle
function.
Upvotes: 2