Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Convert Rank Math FAQ Block Into Accordion
- */
- function turn_rm_faq_to_accordion() {
- ?>
- <script>
- jQuery(document).ready(function() {
- var faqBlock = jQuery("div#rank-math-faq");
- var faqItems = faqBlock.find("div.rank-math-list-item");
- faqItems.bind("click", function(event) {
- var answer = jQuery(this).find("div.rank-math-answer");
- if (answer.css("overflow") == "hidden") {
- answer.css("overflow", "visible");
- answer.css("max-height", "100vh");
- } else {
- answer.css("overflow", "hidden");
- answer.css("max-height", "0");
- }
- });
- });
- </script>
- <?php
- }
- add_action( 'wp_footer', 'turn_rm_faq_to_accordion' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement