Arc-hive-omeka-theme/asset/js/expand-site-list-item.js

19 lines
573 B
JavaScript
Raw Normal View History

2021-11-24 11:02:30 +01:00
$(function(){
$("#site-list").on( "click", ".accordion-title", function() {
2021-11-24 11:22:01 +01:00
var title = this
2021-11-24 11:02:30 +01:00
var content = $(this).closest('.accordion-item')
.find('.accordion-content')
if ($(content).is(':visible')) {
$(content).slideUp('fast')
2021-11-24 11:22:01 +01:00
$(this).closest('.accordion-item').removeClass('is-active')
$(title).attr('aria-expanded', false)
2021-11-24 11:02:30 +01:00
} else {
$(content).slideDown('fast')
2021-11-24 11:22:01 +01:00
$(this).closest('.accordion-item').addClass('is-active')
$(title).attr('aria-expanded', true)
2021-11-24 11:02:30 +01:00
}
return false;
});
})