Javascript 将fadeIn()添加到按钮单击

Javascript 将fadeIn()添加到按钮单击,javascript,jquery,asp.net,Javascript,Jquery,Asp.net,我有以下+-开关用于show/hide表,fadeOut()用于隐藏,我想添加fadeIn(),但不确定放在哪里,我尝试在“壁橱”行的不同点添加第一个块,但没有成功 <script type="text/javascript"> $('#plusMinus').live("click", function () { if ($(this).html() == "+") { $(this).closest("tr").after("<tr><

我有以下+-开关用于
show/hide
表,
fadeOut()
用于隐藏,我想添加
fadeIn()
,但不确定放在哪里,我尝试在“壁橱”行的不同点添加第一个块,但没有成功

<script type="text/javascript"> 
$('#plusMinus').live("click", function () {
    if ($(this).html() == "+") {
        $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>");
        $(this).html("-");
    }
    else {
        $(this).html("+");
        $(this).closest("tr").next().fadeOut();
    }
});

$('#plusMinus').live(“单击”,函数(){
如果($(this.html()==“+”){
(“+$(this).next().html()+”)之后的“$”;
$(this.html(“-”);
}
否则{
$(this.html(“+”);
$(this).recest(“tr”).next().fadeOut();
}
});


 
篮子创建日期
客户参考
量
产品代码
客户产品代码
量
选择以添加


您可以将此指令分开,使用函数:

var new_line = $("<tr><td></td><td colspan='999'>" + $(this).next().html() + "</td></tr>");
var current_line = $(this).closest("tr");

new_line.insertAfter(current_line);
new_line.hide().fadeIn(1000);
var new_line=$(“”+$(this).next().html()+“”);
var current_line=$(此);
新的\u行。插入符(当前\u行);
new_line.hide().fadeIn(1000);
希望这有帮助


$('#plusMinus')。在(“单击”,函数(){
如果($(this.html()==“+”){
var new_line=$(“”+$(this).next().html()+“”);
var current_line=$(此);
新的\u行。插入符(当前\u行);
new_line.hide().fadeIn(1000);
$(this.html(“-”);
}否则{
$(this.html(“+”);
$(this).recest(“tr”).next().fadeOut();
}
});

+

下面是几个演示fadein jquery的示例


$(文档).ready(函数(){
$(“.btn1”)。单击(函数(){
$(“p”).fadeOut()
});
$(“.btn2”)。单击(函数(){
$(“p”).fadeIn();
});
});

这是一段

淡出
淡入
您能否共享标记,以便我们了解
tr
之间的关系?添加了html嵌套转发器。
var new_line = $("<tr><td></td><td colspan='999'>" + $(this).next().html() + "</td></tr>");
var current_line = $(this).closest("tr");

new_line.insertAfter(current_line);
new_line.hide().fadeIn(1000);