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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:33:34+00:00 2026-06-09T19:33:34+00:00

I have a small ajax application thats sends a form and returns data that

  • 0

I have a small ajax application thats sends a form and returns data that matches the form values. When the request completes, the form fades out and the result fades in. The problem is that the page loses about 200px of it’s height, and the page just removes the extra whitespace quite roughly. I want it to animate the extra whitespace off smoothly, or just leave the page as is if it is’t possible to smoothly animate it. Here’s the code:

$(function() {
    $(".eivk").click(function() {
        $("#verkkokauppainfo").hide();
    }); 
    $(".vk").click(function() {
        $("#verkkokauppainfo").show();
    }); 
        $(".back").click(function() {
        $("#service-test").show();
        $("#resultcontainer").hide();
    }); 
}); 
$(function() {
    $("#submit").click(function() {

  if ($('input[name="julkaisu"]:checked').length == 0) {
       $('.error').show();
         return false;
   }

      var dataString = $('#service-test').serialize();
      //alert (dataString);return false;
     $.ajax({
    type: "POST",
    url: "http://www.kotisivut.name/quizs.php",
    data: dataString,
    dataType: "text",
    error: function(){ alert ('Nyt jotakin meni kyllä pahemman kerran pieleen. Yritä uudelleen?');
 },
    success: 
    function(data) {
 $("#resultcontainer").html(data);
 $("#service-test").fadeOut(1400);
$("#resultcontainer").fadeIn(1500);
 $("#page").animate({
    height: "auto"
  }, 1500 );

   }

  });
  return false;

    });
  });    
$(function() {
    $(".eivk").click(function() {
        $("#verkkokauppainfo").hide();
    }); 
    $(".vk").click(function() {
        $("#verkkokauppainfo").show();
    }); 
        $(".back").click(function() {
        $("#service-test").show();
        $("#resultcontainer").hide();
    }); 
}); 
$(function() {
    $("#submit").click(function() {

  if ($('input[name="julkaisu"]:checked').length == 0) {
       $('.error').show();
         return false;
   }

      var dataString = $('#service-test').serialize();
      //alert (dataString);return false;
     $.ajax({
    type: "POST",
    url: "http://www.kotisivut.name/quiz.php",
    data: dataString,
    dataType: "text",
    error: function(){ alert ('Nyt jotakin meni kyllä pahemman kerran pieleen. Yritä uudelleen?');
 },
    success: 
    function(data) {
 $("#resultcontainer").html(data);
 $("#service-test").fadeOut(1400);
$("#resultcontainer").fadeIn(1500);
 $("#page").animate({
    height: "???"
  }, 1500 );

   }

  });
  return false;

    });
  });

I’ve tried using height:auto in the code, but no, it won’t do anything. So I think that I have to retrieve the height off the page, and use it to animate the height.

  • 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-09T19:33:36+00:00Added an answer on June 9, 2026 at 7:33 pm

    Ok, so before you fade out grab the dom height of the parent element of service-test and result container using .height(), and set it using css({ ‘height’:’blah’ }) that way that element will not resize. Then after the fade in is complete animate the parent element to -=200px.

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

Sidebar

Related Questions

I have a small jQuery plugin that I use for form AJAX validation. There
I have a small AJAX application, written in PHP that I did not secure
I have a small web application with ASP.NET AJAX running well under the Cassini
I have a web application that relies on very live data - so it
I have a small ajax application built with php. Using phpMyAdmin I have set
I have small question. When I started to programm my application, I grouped types
I have a jQuery .ajax call: $j.ajax({ type: POST, url: /Services/Cart.asmx/UpdateQuantity, data: data, contentType:
I am performing a jQuery .ajax() call that returns a List<string> of IP addresses
Greetings, I have an asp.net mvc application. I have some links that corresponds to
I have a PHP application that calls web services APIs to get some objects

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.