Okay
  Public Ticket #2342375
Scroll to top on mobile when clicking continue
Closed

Comments

  •  2
    Sian Evans started the conversation

    Is there a way I can make it so that after selecting a date and clicking the Continue button , you are automatically scrolled to the top of the page with the form? I have a #top id tag at the top of every page already, so I just need a way of adding that in on the button link somehow. Thanks in advance for all help! :)

  • [deleted] replied

    Hello Sian Evans ,

    We have couple of JS hooks that are triggered depending on the view:

    window.beforeAddToCalendarLoaded()
    window.beforeBookingLoaded()
    window.beforeSearchLoaded()
    window.beforeSearchFiltered()
    window.afterSearchFiltered()
    window.beforeConfirmedBooking()
    window.beforeCatalogLoaded()
    window.afterSelectCatalogCategory(object_category)
    window.beforeCatalogCategoryLoaded(object_category)
    window.beforeCatalogServiceLoaded(object_category, object_service)
    window.afterSearchActivateService(object_appointment, object_serviceActive)
    window.afterSearchGoToSecondStep(object_appointment, object_serviceActive)
    window.afterBookingSelectDateAndTime(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.afterBookingSelectService(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.beforeConfirmBookingLoaded(object_appointment, object_service, object_provider, object_location)
    window.afterConfirmBooking(object_appointment, object_service, object_provider, object_location)

     So, maybe you can use one of these for your purpose. 

    You can probably use this one

    window.afterBookingSelectDateAndTime(object_appointment, object_serviceId, object_providerId, object_locationId)

    And you can use them like this on the page where you have your Amelia shortcode, but you will need to write a function that will go to the top of your page : 

    <script>
    window.afterBookingSelectDateAndTime = function () {
      
    }
    </script>


    Hope this will help you somehow!

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help. 

  •  2
    Sian Evans replied

    Hi Marija,

    Yes it worked, thank you! :)

    For anyone reading this in the future, I used this code to scroll to the top:

    <script>
    window.afterBookingSelectDateAndTime = function () {
        $(window).scrollTop(0);
    }
    </script>


  • [deleted] replied

    Hello Sian Evans, 

    Glad to hear that! You are welcome. 

    Thank you for sharing that with other users!

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help.