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 9225659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:38:04+00:00 2026-06-18T04:38:04+00:00

I wish that a marker bounces for a few seconds and eventually stops automatically..

  • 0

I wish that a marker bounces for a few seconds and eventually stops automatically.. I am trying this code :

1. globalMarkers[i].setAnimation(google.maps.Animation.BOUNCE);
2. setTimeout(function() {
3.    globalMarkers[i].setAnimation(null)
4. }, 3000);

but for some reason, line 1 executes (hence marker will start bouncing) but the 3rd line returns the following error:

Uncaught TypeError: Cannot call method 'setAnimation' of undefined
        (anonymous function)

Any ideas what it could be?

  • 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-06-18T04:38:06+00:00Added an answer on June 18, 2026 at 4:38 am

    This works fine (with a single global marker object)

        marker.setAnimation(google.maps.Animation.BOUNCE);
    
        setTimeout(function() {
            marker.setAnimation(null)
        }, 3000);
    

    My guess is that you’re interating, and your setTimeout i is not in scope. Try this instead:

        for (var x = 0; x < 5; x++) {
            var marker = markers[x];
            marker.setAnimation(google.maps.Animation.BOUNCE);
            stopAnimation(marker);
        }
    
    
    function stopAnimation(marker) {
        setTimeout(function () {
            marker.setAnimation(null);
        }, 3000);
    }
    

    There are some more creative solutions here:

    Javascript how to use setTimeout on an iterative list operation?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really wish that Google was better at searching for syntax: decades :: (RealFrac
I have a C++ expression that I wish to 'freeze'. By this, I mean
I have this XML structure that I wish to construct in JSON format using
I wish to add a singleton method to a particular object. I wish that
i have an issue with synchronizing Master/slaves processes using MPI. I wish that the
I have a web service that wish to call, and I want to pass
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
Say I have a method that I wish to call which has an argument
I have two panels that i wish to display to the user. I decided
There's one specific feature that I wish was in the .NET framework, but isn't.

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.