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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:46:26+00:00 2026-05-19T02:46:26+00:00

I have clone and remove functions on my page, to which I want to

  • 0

I have clone and remove functions on my page, to which I want to apply slideDown / slideUp animations to respectively:

$('#add-item').click(function(){
    var divCloned = $('.form-fields:first').clone();
    divCloned.insertAfter('.form-fields:last');
    return false;
});

$('.remove').live('click', function(){
    if(confirm("Are you sure you wish to remove this item?"))
    {
        $(this).parent().remove();
    }
    return false;
});

I have tried doing this but either it doesn’t work or the animation is very jerky. Anyone know how this can be done?

  • 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-19T02:46:27+00:00Added an answer on May 19, 2026 at 2:46 am

    for the cloning

    $('#add-item').click(function(){
        var divCloned = $('.form-fields:first').clone();
        // first we hide it (set display to none), then we add it in the DOM 
        // and lastly we aninmate it with slideDown
        divCloned.hide().insertAfter('.form-fields:last').slideDown('fast');
        return false;
    });
    

    and for the removing

    $('.remove').live('click', function(){
        if(confirm("Are you sure you wish to remove this item?"))
        {
            // we use the callback method of the slideUp function
            // so that the removal happens after the animation..
            $(this).parent().slideUp('fast',function(){ $(this).remove(); });
        }
        return false;
    });
    

    Demo at http://www.jsfiddle.net/gaby/qf4j3/

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

Sidebar

Related Questions

I have a php page in which I want to include another php page,
I have the code below which I use clone() and live() . The code
I have the code below which I use clone() and delegate() . The code
I have a ASP.NET (C#) web page which utilizes a VB class library. The
I'm using the jquery plugin ColorBox . I have a page with several item
I have a script that write a iframe into the page. I want to
I have this piece of html in my page. <p><a href=# id=addQueryPart >Add</a></p> <div
I have this piece of html in my page. <p><a href=# id=addQueryPart >Add</a></p> <div
I have a div, which has jQuery UI Draggable applied. What I want to
I have a form on my page which gives the user the possibility to

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.