Question: I am trying to animate a footer section in a webpage, and found out that the jQuery `.animate()` method doesn't 'animate' when using percentages (apparently is a bug still not fixed as of jQuery 1.10.2?). So, as suggested by [another answer on SO](https://stackoverflow.com/questions/6877081/jquery-animate-and-property-values-in-percentage) I should use notation for the parent's height, plus `'px'` to allow jQuery to animate properly. So I tried that, but this breaks the function :/

From my [JS Fiddle](http://jsfiddle.net/zYzT2/), I have this code:

```
$(function () {
 var open = false;
 $('#footbutton').click(function () {
     if (open === false) {
         $('#footcontent').animate({
             height: '100%'
         });

         open = true;
     } else {
         $('#footcontent').animate({
             height: '0px'
         });

         open = false;
     }
   });
  });

```

This works, except, the `#footcontent` div instantly pops open with no animation (but works fine when closing, as I have height set in px). Replacing `height: '100%'` with `height: $('footer').height() +'px'` breaks the function, where for some reason jQuery now sees the parent's height at 0px and cannot make any changes in height.

How can the two be different? I've tried replacing `$('footer').height()` with `$(#footcontent).parent().height()` and it's a no-go as well. Surely I'm missing something here or just being dense...it is 4am my time........

Answer: 
There is not a way to do this when using mod\_cgi and a single process. It's heavy on resources, but a generally accepted method of achieving this is called a double fork. It goes something like this:

```
pid_t kid, grandkid;
if ((kid = fork())) {
    waitpid(kid, null, 0);
}
else if ((grandkid = fork())) {
    exit(0);
}
else {
    // code here
    // do something long lasting
    exit(0);
}

```

[Adapted from this PERL code](http://modperlbook.org/html/10-2-4-Avoiding-Zombie-Processes.html#pmodperl-CHP-10-EX-18)
You might check out [FastCGI](https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html). It allows you to stick closely to the CGI programming model but decouples request lifetime from process lifetime. You could then do something like this:

```
while (FCGI_Accept() >= 0) {
    // handle normal request
    FCGI_Finish();
    // do synchronous I/O outside of request lifetime
}

```