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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:47:02+00:00 2026-05-21T16:47:02+00:00

I have following code snippet in jquery.In which,I want to animate each element of

  • 0

I have following code snippet in jquery.In which,I want to animate each element of array one by one.

<script type="text/javascript">
        function AnimateText() {
            var myCars = new Array("Saab", "Volvo", "BMW");
            myCars.each(function () {
                $(this).fadeIn("2000").fadeOut("2000");
            });

        }

    </script>

But I am getting this error Object does not support this method or property

EDIT

Thanks all for the answer.Now I have problem in animating the array element on the screen.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default7.aspx.cs" Inherits="Default7" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function AnimateText() {
            var myCars = new Array("Saab", "Volvo", "BMW");
            $.each(myCars, function (key, value) {
                $("#myDiv").html(value).fadeIn("2000") ;
            });

        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="myDiv"></div>
    <input type="button" id="btnTest" value="Animate" onclick="AnimateText();" />
    </form>
</body>
</html>
  • 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-21T16:47:02+00:00Added an answer on May 21, 2026 at 4:47 pm

    You need to use the static $.each() method:

    var myCars = ["Saab", "Volvo", "BMW"];
    // Capture this because inside the loop it will have a different meaning
    var $this = $(this);
    $.each(myCars, function () {
        $this.fadeIn("2000").fadeOut("2000");
    });
    

    You also probably want to show this text in some DOM element:

    var myCars = ["Saab", "Volvo", "BMW"];
    $.each(myCars, function () {
        $('#spinner').html(this).fadeIn("2000").fadeOut("2000");
    });
    

    where for example spinner is a div:

    <div id="spinner"></div>
    

    UPDATE:

    After seeing your update it is more clear to me what you are trying to achieve. You could use the .delay() method:

    var myDiv = $('#myDiv');
    var myCars = ['Saab', 'Volvo', 'BMW'];
    
    $('#btnTest').click(function() {
        $.each(myCars, function(index, value) {
            var val = value;
            myDiv.delay(1000).fadeIn(1000, function() {
               myDiv.text(val);
            });
        });
    });
    

    And here’s a live demo.

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

Sidebar

Related Questions

I have following code (html,js,jquery) snippet ( http://jsfiddle.net/MUScJ/2/ ): <script type=text/javascript> function someFunc(){ html
I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id':
I have the following code snippet: enum { one } x; enum { two
I have the following snippet, which uses the jQuery Form plugin to post a
I have the following snippet of code (see below) and want to make the
I have following code snippet and i am trying to evaluate the time take
I have following code snippet that i use to compile class at the run
I have following code snippet: class ABC{ public: int a; void print(){cout<<hello<<endl;} }; int
I have the following code snippet. $items['A'] = Test; $items['B'] = Test; $items['C'] =
I have the following code snippet where some strings are initialized in the if

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.