Page 1 of 1

Disable Autoscroll?

Posted: Wed Jun 09, 2021 2:43 pm
by thewebguys
Hi
A lot of our users are complaining about the auto scroll feature with the forum embedded on a wordpress page, as it always scrolls back to the top for example when click the back button. Is it possible to disable this feature? I tried setting various integers in the options page, but it always does the same. Can I remove some code from a file to disable this?
Thanks
Jon

Re: Disable Autoscroll?

Posted: Thu Jun 10, 2021 6:49 am
by axew3
hi, the unique code that interact with this, is the one into page-forum.php
that is the file you have into your active template folder, named as the blank page you created (that so when you call the url, the page load).
Into this file, there is this code:

Code: Select all

      var w3all_lochash = /.*(#w3all_lochash)=([0-9]+).*/ig.exec(res);
      if(w3all_lochash !== null && w3all_lochash[2] != 0){ 
         jQuery('html, body').animate({ scrollTop: w3all_lochash[2]}, 400);
       } else {
         jQuery('html, body').animate({ scrollTop: ".$w3all_iframe_custom_top_gap."}, 400);
       }
the var w3all_lochash is sent back to the wp page-forum by the phpBB overall_footer.html code you added into phpBB when it is called into the wp page as an iframe:
by default, the scroll isset to w3all_lochash[2] value or $w3all_iframe_custom_top_gap.

$w3all_iframe_custom_top_gap is the value to set for the default position to scroll to, when w3all_lochash[2] is NOT 0

You can manually change these values or even remove and substitute the entire code.

400 is the value of the scroll speed

The whole iframe logic, the scroll and several iframe issues will be soon moved to the next step on next coming soon version

EDITED

Re: Disable Autoscroll?

Posted: Thu Jun 10, 2021 10:19 am
by axew3
the above answer, that was wrong, as been updated

Re: Disable Autoscroll?

Posted: Thu Jun 10, 2021 12:51 pm
by thewebguys
Thank you very much :-)