Looking at the source jquery.ui.accordion.js, it is just an object containing the newly selected item.
You can see for yourself if you just look at the source:
// find elements to show and hide var toShow = clicked.next(), toHide = this.active.next(), data = { options: options, newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, oldHeader: this.active, newContent: clickedIsActive && options.collapsible ? $([]) : toShow, oldContent: toHide }, down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); this.active = clickedIsActive ? $([]) : clicked; this._toggle( toShow, toHide, data, clickedIsActive, down ); return; },
newHeader is not an array, it is an object that represents the new selected item. The code you sent finds all the h3 elements in the accordion element, and then it takes the newHeader index. The element that newHeader represents changes every time the accordion changes.
source share