• Hello,

    I have the page
    https://www.ortoclass.ro/programari/

    I don’t know for that reason, the page keeps autoscrolling to the reservation contact form. I can’t find the code that does that in order to eliminate it.

    Does anyone have any idea about how to disable this feature?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    I’m suspecting it is caused by the booking plugin you are using, I can see several references to a certain scrollTo() function in its main Javscript file: https://www.ortoclass.ro/wp-content/plugins/appointment-booking/frontend/resources/js/bookly.js?ver=9.4
    You can check if it’s one of those by editing this part right at the bottom of that file:

    function scrollTo($elem) {
                var elemTop   = $elem.offset().top;
                var scrollTop = $(window).scrollTop();
                if (elemTop < $(window).scrollTop() || elemTop > scrollTop + window.innerHeight) {
                    $('html,body').animate({ scrollTop: (elemTop - 24) }, 500);
                }
            }

    Delete or comment out (with // ) the line that does the scrolling:

    function scrollTo($elem) {
                var elemTop   = $elem.offset().top;
                var scrollTop = $(window).scrollTop();
                if (elemTop < $(window).scrollTop() || elemTop > scrollTop + window.innerHeight) {
                    // $('html,body').animate({ scrollTop: (elemTop - 24) }, 500);
                }
            }

    Then make sure that your browser is loading the new file when you test it.
    Hope that helps.

    Thread Starter ortoclassro

    (@ortoclassro)

    Hello,

    Thank you for your help, but unfortunately it isn’t that certain line. I commented it out but now the plugin doesn’t load at all.

    The problem surely comes from the plugin, but it must be another line of those that loads, not that one.

    Any other ideas would be greatly appreciated.

    Thank you.

    Thread Starter ortoclassro

    (@ortoclassro)

    My bad. It works perfectly now, it seems there was a problem with my page.

    Appreciate your help. ??

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page scrolling automatically’ is closed to new replies.