Advertisement
MikeGTS

Untitled

Jul 9th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   <script type='text/javascript'>
  2.   //<![CDATA[
  3.   $(window).load(function(){
  4.  
  5.     $("#parent2, #parent3").css("display","none");
  6.     $(".aboveage2").click(function(){
  7.  
  8.         if ($('input[name=age2]:checked').val() == "Yes"){
  9.             $("#parent3").slideUp("fast"); // HIDE
  10.             $("#parent2").slideUp("fast"); // HIDE
  11.             $.cookie('showTop', 'collapsed'); //Add cookie 'ShowTop'
  12.         }
  13.    
  14.         if ($('input[name=age2]:checked').val() == "No") {
  15.             $("#parent2").slideDown("fast"); // SHOW
  16.             $("#parent3").slideUp("fast"); // HIDE
  17.             $.cookie('showTop', 'expanded'); //Add cookie 'ShowTop'
  18.         }
  19.         if ($('input[name=age2]:checked').val() == "Maybe") {
  20.             $("#parent3").slideDown("fast"); // SHOW
  21.             $("#parent2").slideUp("fast"); // HIDE
  22.             $.cookie('showTop', 'expanded3'); //Add cookie 'ShowTop'
  23.         }
  24.  
  25.      });
  26.         var showTop = $.cookie('showTop');
  27.        
  28.         if (showTop == 'expanded') {
  29.         $("#parent2").show("fast");
  30.         $('input[name=age2]:checked');
  31.         } else {
  32.         $("#parent2").hide("fast");
  33.         $('input[name=age2]:checked');
  34.        }
  35.        
  36.         if (showTop == 'expanded3') {
  37.         $("#parent2").hide("fast");
  38.         $("#parent3").show("fast");
  39.         $('input[name=age2]:checked');
  40.        }
  41.  
  42.        
  43.        
  44.  
  45.   });
  46.   //]]>
  47.   </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement