Hello,
Can someone post a code snippet showing how to get the selectedItemIndex from ejAccordion when it changes? I am trying to use the activate event without success.
Below is the code I am using. The activate event does not seem to fire. The console will show the selectedItemIndex when the page loads but not when the active accordion item changes.
Thanks, Randy
<script>
var accrdnObj;
$(function () {
$('#courseGroupAccordion').ejAccordion({
activate: function(){
accordionChange();
},
enableAnimation: false,
showRoundedCorner: true
});
acrdnObj = $("#courseGroupAccordion").data("ejAccordion");
var index = acrdnObj.option("selectedItemIndex");
console.log('selectedItemIndex: ' +
index);
});
function accordionChange() {
debugger;
var index = acrdnObj.option("selectedItemIndex");
console.log('selectedItemIndex: ' +
index);
}
</script>