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

  • SEARCH
  • Home
  • 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 7980149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:58:44+00:00 2026-06-04T09:58:44+00:00

I am adding few results on click of a button. I am using slideDown

  • 0

I am adding few results on click of a button. I am using slideDown method to show these new results, but no idea why these new results first slideUp and then perform a slideDown animation. And when I clear added results, it is removed instantly with no animation at all.

Please have a look on this demo: http://jsbin.com/imulem

$('#sb').click ( function(){
var html = '';

  html += "<div class='result'>" + 'fake results.. ' +  '</div>';
  html += "<div class='result'>" + 'fake results.. ' +  '</div>';
  html += "<div class='result'>" + 'fake results.. ' +  '</div>';
  $(html).hide().prependTo('#searchresults').slideDown('slow');
        });


$('#clearb').click ( function(){
            $('#searchresults>div').slideUp('slow').remove();
        });
  • 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-04T09:58:46+00:00Added an answer on June 4, 2026 at 9:58 am

    I gave to .result a class named h0 which has height: 0px; property. This way they have no height when you click #sb. You should remove divs after animation ends.

    For chrome problem, change the transition from all to background-color.

    You can find working case here.

    CSS

    .h0 { height: 0px; }
    #searchresults .result{
      padding: 1.2em;
      margin-left: 2em;
      color: #690011;
      border-radius: 1.8em;
      -webkit-transition: background-color 1s ease-in-out;
      background-color: #F0B616;
    }
    

    Javascript

    $('#sb').click ( function(){
      var html = '';
    
      html += "<div class='result h0'>" + 'fake results.. ' +  '</div>';
      html += "<div class='result h0'>" + 'fake results.. ' +  '</div>';
      html += "<div class='result h0'>" + 'fake results.. ' +  '</div>';
      $(html).hide().prependTo('#searchresults').slideDown('slow');
    });
    
    
    $('#clearb').click ( function(){
      var $divs = $('#searchresults>div');
      $divs.slideUp('slow', function() { $divs.remove(); });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery to dynamically add new divs containing a few fields. I'm adding
Adding the row one by one in the button click.. (i tried but its
I am adding a few new features to a small project i'm working on
I am adding an admin namespace with a few controllers, so our stuff can
Context: I'm working on master adding a simple feature. After a few minutes I
Adding more than one child to a WPF StatusBar results in poor layout with
Adding Exceptional Handling is a good practise, but I have a doubt, In our
Adding functionality to a class can be done by adding a method or by
Adding strings localization files in iPhone bundle is very simple and perfectly fine but
I am using this OAuth lib: http://github.com/jdg/oauthconsumer When adding it to my project, it

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.