Fade In and Fade Out DIV tag with JQuery based on Checkbox selection in Asp.Net
My previous article discussed about showing and hiding the div tag based on checkbox selection using JQuery. The below code snippet will help us to do the same with fading effect.
<script language="javascript">
$(document).ready(function() {
$("#chkShowPersonal").click(function() {
if ($("#chkShowPersonal").attr("checked")) {
$("#dvPersonal").fadeIn("slow");
} else {
$("#dvPersonal").fadeOut("slow");
}
});
});
</script>
<asp:CheckBox ID="chkShowPersonal" onclick="EnableDisableDIV()" runat="server" />
<div id="dvPersonal" style="display:none">
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</div>
The fadeIn() and fadeout() method can take values slow, medium, fast and number in milliseconds.
|