Last active
September 23, 2021 01:56
-
-
Save wplit/addb5e12b50625c5ab0ab58a061cf325 to your computer and use it in GitHub Desktop.
open accordion header when linked to with button. updated - add to code block
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
jQuery(document).ready(function($) { | |
let buttonSelector = '.research-card-image-overlay'; | |
let delay = 500; | |
$(buttonSelector).on('click', function() { | |
if ($(this).attr('href')) { | |
let hash = $(this).attr('href').split('#')[1]; | |
if (hash) { | |
setTimeout(function(){ | |
if ('false' === $('#' + hash).find('.oxy-pro-accordion_header').attr('aria-expanded')) { | |
$('#' + hash).find('.oxy-pro-accordion_header').trigger('click'); | |
} | |
}, delay); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment