lesterchan/wp-showhide

After opening hidden section the page scrolls to the top

mghile opened this issue · 3 comments

When click on the display link the page shows that section BUT also scrolls to the top of the page. It should remain at the place where the previously hidden text is displayed.

You need to be using different types for multiple showmore.

Yes, for each showmore I do use a different type. The correct individual section opens when I click the more_text link. It just scrolls to the top of the page when I open any of the individual links. Each of the sections opens.

This is what I am using
[showhide type="youth" more_text="What our Youth Group does" less_text="less..."]
Here is what it looks like in the source

<p><div id="youth-link-5203" class="sh-link youth-link sh-hide"><a href="#" onclick="showhide_toggle('youth', 5203, 'What our Youth Group does', 'less...'); return false;" aria-expanded="false"><span id="youth-toggle-5203">What our Youth Group does</span></a></div><div id="youth-content-5203" class="sh-content youth-content sh-hide" style="display: none;"></p>
<p><span style="font-size: 1em;"><br />
The group celebrates and shares the diversity of its interests and talents with the whole congregation by creating a special Youth Group Sunday Platform program in May. </span></p>
<ul>
<li>9th through 12th grades</li>
<li>Sundays,10:00-12:00</li>
<li>September through May</li>
</ul>

But the page does not return to the correct location after the link is clicked scrolling to the top instead. I have the same issue in Firefox, Chrome, and Edge.

What am I missing?

Hmm not sure if it is a plugin conflict did you try on the default theme with no other plugins enabled?