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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:27:33+00:00 2026-06-01T09:27:33+00:00

I have an disappearing delete animation code and I want to get the entire

  • 0

I have an disappearing delete animation code and I want to get the entire div “parent_parent” to disappear.

Here is the HTML

<div class="parent_parent">
    <div class="parent">
        <a href="?delete=1" class="delete_link"></a>
    </div>
</div>

And here is part of the jquery code that makes the parent_parent div disappear:

$(document).ready(function() {
    $('a.delete_element').click(function(e) {
        e.preventDefault();
        var parent = $(this).parent();
        $.ajax({
            type: 'get',
            url: 'delete.php',
            data: 'ajax=1&delete=' + parent.parent().attr('id').replace('sort_', ''),
            beforeSend: function() {
                parent.parent().animate({
                    'backgroundColor': '#fff'
                }, 300);
            },
            success: function() {
                parent.parent().slideUp(300,function() {
                parent.parent().remove();
                });
            }
        });
    });
});​

But so far no animation happens, but if I just call one parent then the inside div does disappear. I don’t get any error messages either.

  • 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-01T09:27:34+00:00Added an answer on June 1, 2026 at 9:27 am

    Your code is still too complicated for what you are trying to do. This is better:

    // $(function(){ is shorthand for $(document).ready(function(){
    $(function() {
        $('a.delete_element').click(function(e) {
            e.preventDefault();
            // Don't give thing ambiguous names like 'parent'
            // You should change your class names too.
            var container = $(this).closest(".parent_parent");
            $.ajax({
                type: 'get',
                url: 'delete.php',
                // You had multiple instances of parent.parent(), but no direct usage of parent alone
                // This is a clue that you can simplify parent.parent() since you are traversing to the same element every time
                data: 'ajax=1&delete=' + container.attr('id').replace('sort_', ''),
                beforeSend: function() {
                    containter.animate({
                        'backgroundColor': '#fff'
                    }, 300);
                },
                success: function() {
                    container.slideUp(300, function() {
                        // Do not repeat the same selector within a callback
                        // That's what `this` is for
                        $(this).remove();
                    });
                }
            });
        });
    });​
    

    If you use this code example as it is, it will work.

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

Sidebar

Related Questions

have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have some JQuery code that shows or hides a div. $(div#extraControls).show(); // OR
I have some HTML stuff like this <div id='divItemHolder'onMouseout='HideEditDiv()' onMouseover='ShowEditDiv()><div id='itemName'></div><div id='divEdit'></div></div> and in
I have a disappearing pointer db ; the value is properly set during creation
have written this little class, which generates a UUID every time an object of
Have an issue with marshall and unmarshall readers and writers. So here it is.
Does anybody have a scoop on JQuery 1.6.1 disappearing from Google APIs? Today, on
Come see the amazing disappearing rectangle! But seriously I have a really simple HTML5
I have the following code, which basically takes values from a database and populates
I think it's considered a bad practice to have controls appearing and disappearing and

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.