CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » CodeDigest » Fade In and Fade Out DIV tag with JQuery based on Checkbox selection   You are not logged in.
Search
 

Sponsors
InstallShield
 

Sponsored Links
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Fade In and Fade Out DIV tag with JQuery based on Checkbox selection
Fade In and Fade Out DIV tag with JQuery based on Checkbox selection
Submitted By Satheesh Babu
On 12/13/2008 3:38:01 AM
Tags: CodeDigest,JQuery  

Fade In and Fade Out DIV tag with JQuery based on Checkbox selection

 

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!!