Forked from jonmunson/foundation5-accordion-animate.html
          
        
    
          Last active
          August 29, 2015 14:15 
        
      - 
      
- 
        Save carlosasin/29c308e0c15d660d5926 to your computer and use it in GitHub Desktop. 
    JS - Foundation nimate accordion
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script src="/bower_components/foundation/js/foundation/foundation.accordion.js"></script> | |
| <script> | |
| //reflow after page load | |
| $(document).foundation('accordion', 'reflow'); | |
| //animate open/close | |
| $(".accordion dd").on("click", "a:eq(0)", function (event) { | |
| var dd_parent = $(this).parent(); | |
| if(dd_parent.hasClass('active')) { | |
| $(".accordion dd div.content:visible").slideToggle("normal"); | |
| } else { | |
| $(".accordion dd div.content:visible").slideToggle("normal"); | |
| $(this).parent().find(".content").slideToggle("normal"); | |
| } | |
| }); | |
| </script> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment