Created
July 6, 2016 08:46
-
-
Save denniserdmann/29adfbcff9588340124c2d4993da43db to your computer and use it in GitHub Desktop.
Contao Accordion - Closed by default (jQuery)
This file contains 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="<?= TL_ASSETS_URL ?>assets/jquery/ui/<?= $GLOBALS['TL_ASSETS']['JQUERY_UI'] ?>/jquery-ui.min.js"></script> | |
<script> | |
(function($) { | |
$(document).ready(function() { | |
$(document).accordion({ | |
// Put custom options here | |
heightStyle: 'content', | |
header: 'div.toggler', | |
collapsible: true, | |
active: false, | |
create: function(event, ui) { | |
ui.header.addClass('active'); | |
$('div.toggler').attr('tabindex', 0); | |
}, | |
activate: function(event, ui) { | |
ui.newHeader.addClass('active'); | |
ui.oldHeader.removeClass('active'); | |
$('div.toggler').attr('tabindex', 0); | |
} | |
}); | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok