lesterchan / wp-showhide

Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link.
https://wordpress.org/plugins/wp-showhide/
24 stars 11 forks source link

After opening hidden section the page scrolls to the top #5

Closed mghile closed 6 years ago

mghile commented 7 years ago

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.

lesterchan commented 7 years ago

You need to be using different types for multiple showmore.

mghile commented 7 years ago

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?

lesterchan commented 7 years ago

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