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