Collapse on jump link click
-
Hi,
I’ve added my own CSS to make the table sticky to my nav bar when the user scrolls down. I’ve used the plugin settings to make it hidden by default.How can I make it so that the table of contents collapses/hides when the user clicks one of the jump links in the list?
I’ve tried writing JS to watch for clicks on .ez-toc-link and then force the table to collapse:
#ez-toc-container .eztoc-toggle-hide-by-default {
display: none !important;
}But it keeps being overridden, I believe by the plugin’s code, to stay open/on display:
<ul class="ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default" style="display: block;">
Which means the table of contents stays open after a jump link is clicked and the user has to manually close the featured to continue reading.
Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.