如何动画/突出显示在隐藏 我想首先设置动画或突出显示 Clicked或Selected Div,然后隐藏它。 以下是HTML: 这是CSS: 这是JS: 答案 0 :(得分:1) 动画背景颜色需要jQuery.Color插件(或jQuery UI)。 答案 1 :(得分:0)Here is my JS DEMO:
<div id="response_1" class="container">
<span id="1" class="hide_content">
<a href="javascript:void(0);">Click Here To Hide First Div</a>
</span>
</div>
<br>
<div id="response_2" class="container">
<span id="2" class="hide_content">
<a href="javascript:void(0);">Click Here To Hide Second Div</a>
</span>
</div>
<br>
<div id="response_3" class="container">
<span id="3" class="hide_content">
<a href="javascript:void(0);">Click Here To Hide Third Div</a>
</span>
</div>
.container{
border:#666666 solid 1px;
padding:4px;
}
$('.hide_content').click(function ()
{
var current_number = $(this).attr("id");
$('#response_'+current_number).hide();
});
2 个答案:
$('.hide_content').click(function () {
$(this).closest(".container").animate({ "background-color": "yellow" }, 500, "linear").
delay().fadeOut(500)
});