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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:04:29+00:00 2026-06-02T01:04:29+00:00

I have a current problem with jQuery animations… here’s what I’m currently doing… I

  • 0

I have a current problem with jQuery animations… here’s what I’m currently doing… I have four multiple select menus that when changed I wish to put the selected values in a table which has 4 different tbody tags (areas) which I have made unique with IDs. The reason I need the 4 different tbody areas is due to the nature of the data I am displaying, it must be in a certain order. Anyway my real problem is this, when the user changes or amends the values of the menus I wish to capture the event, determine which menu was clicked, obtain its value (or values) and display this in the appropriate part of the table. Now to be snazzy (and due to the rules associated with the selections) I wish to fade out the previous menu selection and fade in the new selection.

I’ve stripped down my code and what I have works however the new content is being duplicated two fold everytime I run the function (or click one of the select menus). The old content simply fades away, the new content then fades in… but instead of 1 row I have 2. The new time I run it my content fades out then 4 new rows are created. Here’s a minimized version of what I have… why is the content duplicated, am I being stupid or something?

$(document).ready(function() {
    changeTable();
});


  function changeTable(){

    var selectArray = ["cat", "catOpt", "tariff", "tariffOpt"], // these are the IDs of the select menus...
        i;

    for(i=0;i<selectArray.length;i++){
        $("#" + selectArray[i]).click(function () {
            if(this.id == "cat"){
                $('#dynamicTableHolder #dtCats').find("td").fadeOut(1000, function(){ 
                    $(this).parent().remove(); // due to problems with jQuery we have to fadeOut the TDs then remove the TR
                    $('#dynamicTableHolder #dtCats').append('<tr><td>'  + $("#cat").val() + '</td><td></td></tr>').hide().fadeIn(1000); // Now let's fade in some new content
                });
            }
        }); 
    }       
  }

Here’s a JSfiddle so you can see the issue…

http://jsfiddle.net/itakesmack/xKZfr/1/

  • 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-02T01:04:30+00:00Added an answer on June 2, 2026 at 1:04 am

    Your problem is with this line :

    $('#dynamicTableHolder #dtCats').find("td")
    

    this is finding multiple tds so your code is executing per td …

    You could try this approach – this replaces the current row in the table : http://jsfiddle.net/xKZfr/2/

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

Sidebar

Related Questions

So in jQuery, I have a global variable currentSubNav that stores a current visible
I have a field accountname that uses Jquery autosuggest in a textbox. Here as
I have a web application that uses the current version of JQuery that needs
In jQuery: Scenario ** - I have four Divs that have hover effects. -
In my current JQuery, I have an event that will either check or uncheck
I have a problem with obtaining the current user location. Code at first works
The following code summarizes the problem I have at the moment. My current execution
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I have a fancybox, and for some reason it gets cached. My current problem
Here is my current problem. I am working with the chat module and I'm

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.