-1

Problem

Can't get prependTo() and slideDown() functions work together.

Short

Please take a look at the code.

http://jsfiddle.net/tt13/5CxPr/53/

Press "new" to see what happens

Am I missing something?

Detailed

Here is JS code

function newrow(elem){
    if($("#"+elem+"s").is(":hidden")){
        $("#"+elem+"s").slideDown("slow")
    }
    $('<tr />').addClass(elem).append(
        $('<td />').text('new row')
        ).prependTo("#"+elem+"s").slideDown("slow");
            
}

$(document).ready(function() {
       $(".new").click(function() {
        newrow($(this).attr("id").replace("add_",""))
    });
});​
Community
  • 1
  • 1
Tural Ali
  • 22,202
  • 18
  • 80
  • 129

1 Answers1

1

Don't use tables. They don't like being animated.

Use divs instead

Ryan Kinal
  • 17,414
  • 6
  • 46
  • 63