$('.invoice_resend').hide();
$('.invoice_resend #update_paid').hide();
$('.invoice_send').hide();
所以我上面有这段代码,classinvoice_resend
是一个 div,当单击按钮时,它会被隐藏,如上图所示,#update_paid
and.invoice_send
也将被隐藏,给我留下一个“ RESIZED DIV ”元素。
我想要的是,当所有其他元素都被隐藏时,.invoice_resend div
将保持其高度或任何需要编辑的内容。
编辑:
好的,这是我的整个代码:
if (selected_tab == 0) { //Released tab
$('.invoice_resend').hide();
$('.invoice_send').show();
}
else if ( selected_tab == 1 ) { //Invoiced tab
$('.invoice_resend').show();
$('.invoice_resend #update_paid').show();
$('.invoice_send').hide();
}
else if ( selected_tab == 2 ) { //Paid tab
$('.invoice_resend').show();
$('.invoice_resend #update_paid').hide();
$('.invoice_send').hide();
}
else if ( selected_tab == 3 ) { //Pending tab
$('.invoice_resend').hide();
$('.invoice_resend #update_paid').hide();
$('.invoice_send').hide();
}
似乎css.({visibility: 'hidden' or 'visible'})
完成了这项工作,但产生了另一个问题。你看,我有几个标签,所以当我点击隐藏所有元素的最后一个标签时,当我点击另一个标签时,它会变得不稳定,显示或隐藏随机元素。上面的代码是我的原始代码,我根据您的回答将其全部编辑为 .css。