问题
无法获取prependTo()
和slideDown()
函数一起工作。
短的
请看一下代码。
http://jsfiddle.net/tt13/5CxPr/53/
按“新”看看会发生什么
我错过了什么吗?
详细的
这是JS代码
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_",""))
});
});