18 | | jQuery(document).ready( function($) { |
19 | | // Expand/Collapse |
20 | | $('.accordion-section-title').on('click keydown', function( event ) { |
21 | | |
22 | | if ( event.type === 'keydown' && 13 !== event.which ) // enter |
23 | | return; |
24 | | |
25 | | var clicked = $( this ).closest( '.accordion-section' ); |
26 | | |
27 | | if ( clicked.hasClass('cannot-expand') ) |
28 | | return; |
29 | | |
30 | | clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' ); |
31 | | clicked.toggleClass( 'open' ); |
32 | | event.preventDefault(); |
33 | | }); |
34 | | }); |
35 | | jQuery(document).ready( function($) { |
36 | | // Expand/Collapse |
37 | | $('.accordion-section-title').on('click keydown', function( event ) { |
38 | | |
39 | | if ( event.type === 'keydown' && 13 !== event.which ) // enter |
40 | | return; |
41 | | |
42 | | var clicked = $( this ).closest( '.accordion-section' ); |
43 | | |
44 | | if ( clicked.hasClass('cannot-expand') ) |
45 | | return; |
46 | | |
47 | | clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' ); |
48 | | clicked.toggleClass( 'open' ); |
49 | | event.preventDefault(); |
50 | | }); |
51 | | }); |
52 | | No newline at end of file |