Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7499275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:46:32+00:00 2026-05-29T19:46:32+00:00

I have a map container DIV. Lets call it #mapcontainer. I animate its height

  • 0

I have a map container DIV. Lets call it #mapcontainer.

I animate its height with jQuery:

$("#mapcontainer").animate({height: +=200px}, 500);

I know that if a map container is resized google maps needs to be triggered to be resized using:

google.maps.event.trigger(map, 'resize');

Now the obvious thing is to do this in the callback of animate:

$("#mapcontainer").animate({height: +=200px}, 500, "linear", function(){
    google.maps.event.trigger(map, 'resize');
});

But this doesn’t look smooth and the map just juts to the hight after the animation has completed.

Is there anyway that the map can be resizing as the animation is running so the map transitions smoothly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:46:33+00:00Added an answer on May 29, 2026 at 7:46 pm

    You trigger the event after the animation is complete and I think it’s the issue.

    It’s not a good solution but maybe you can use setInterval and trig the event every 1ms when the animation is running. Maybe it it will lag, and as I said its not a best-practies solution.

    var timer;
    
    timer = setInterval(function(){ google.maps.event.trigger(map, 'resize')}, 100);
    $("#mapcontainer").animate({height: +=200px}, 500, "linear", function(){
        timerMap = clearInterval(timer);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map container. I want to copy all its keys with user
I know that the Map container in STL is internally a Red-Black Tree, which
I have a map with a bunch of buttons that show and hide container
So I have a container(any kind, probably std::map or std::vector) which contains objects of
I have a service that contains a map: static Map cargosMap = ['1':'item1','2':'item 2','3':'item
I have a map for my game, I have a script that on a
I have a CSS map of Brazil that I want to make have yellow
I have next problem: There is jquery accordion control. One of tab have div
I have an infoBox displayed on a map that is populated with a list
hi i have a function that worked fine using jQuery 1.3.2 but now i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.