CODEDIGEST
Home » CodeDigest
Search
 

Technologies
 

Fade In and Fade Out DIV tag with JQuery based on Checkbox selection in Asp.Net
Submitted By Satheesh Babu B
On 12/13/2008 3:38:01 AM
Tags: CodeDigest,JQuery  

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.

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!

Recent Codes
  • View All Codes..