Accordions WordPress Plugin – how to edit the "Click Header to scroll top" function

Q&ACategory: PluginAccordions WordPress Plugin – how to edit the "Click Header to scroll top" function
Giorgio asked 1 year ago

Hi there.
So this is my issue.
When I activate the “Click Header to scroll top” function within my accordion, the page scrolls to the top but too much
Is not considering the website header space.
 
Which file do I have to touch in order to add a value of something like 130px? 
I need it to scroll up but until a certain point.
 
Thank you! 

1 Answers
Nur Hasan Staff answered 1 year ago

Welcome to our forum
Please go this file
Line: 44
accordions/templates/scripts.php
add your value , see i have added (-130)

$("html:not(:animated), body:not(:animated)").animate({ scrollTop: ui.newHeader.offset().top - 130 }, "slow");

 http://i.imgur.com/0nIitSo.png

This should work.
Let me know the result.
Regards
 

Hasan Staff replied 1 year ago

Please note, values should be integer, value with px will not work. Regards

Giorgio replied 1 year ago

It seems to work atm! Thank you

Hasan Staff replied 1 year ago

You are Funny 🙂 , Great to know its works, Let me update the plugin i will add option under the “Click Header to scroll top” to set custom value, Regards

Hasan Staff replied 1 year ago

If you have little time please submit us five star reviews https://wordpress.org/plugins/accordions/ , Regards