JS No Longer Works after Cornerstone Update

Hello,

I have been using the following JS to open an accordion based on a url hash id. This worked well up until I updated to the latest version of Cornerstone today. Now it doesn’t work at all.

jQuery( function( $ ) {
$( document ).ready ( function() {
var target_tab = window.location.hash;
var accordion = $( target_tab ).find(’.x-accordion-body’).removeClass(‘collapse’);
});
});

I’ve cleared caches, etc. but nothing seems to work. Has the way accordions work changed in the new version, and if so, what are the new class commands to make the accordion open?

Hello There,

Thanks for writing in! The code no longer work because there was changed in the class being used in the element. Please have it updated and use this instead:

jQuery( function( $ ) {
	$( document ).ready ( function() {
		var target_tab = window.location.hash;
		var accordion = $( target_tab ).find('.x-accordion-body').removeClass('x-collapsed');
	});
});

Hope this helps. Kindly let us know.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.