Scroll to results after new page has opened

Forums › Forums › General › Scroll to results after new page has opened

Viewing 7 posts – 1 through 7 (of 7 total)
  • Anonymous
    #214300

    Hi,

    I use a SFP widget on my homepage at fertila.de. After submitting, a new page is opened with the results. I want users to land right on the results (especially important on mobile). I tried in the settings the Ajax scroll to custom selector. However this seems not to work in a new window.

    Thanks for your help
    Georg

    Trevor
    #214307

    Results URL appears to be:

    https://fertila.de/kinderwunschzentren/

    You would need to add some Javascript to the page that, on document load, scrolls the page to the div with ID search-filter-results-8030.

    Anonymous
    #214309

    OK, great. What js would I have to add?
    Thank you
    Georg

    Trevor
    #214311

    I haven’t tested this, but something like:

    <script>
    (function ( $ ) {
      $(document).on("ready", function(){
        $('html, body').animate({
            scrollTop: $('#search-filter-results-8030').offset().top
        }, 'slow');
      });
    }(jQuery));
    </script>
    Anonymous
    #214313

    Works. However, now there is an autoscroll as well when I just enter the URL https://fertila.de/kinderwunschzentren/
    Which I do not want.

    Trevor
    #214320

    Try this maybe:

    <script>
    (function ( $ ) {
      $(document).on("ready", function(){
        if (window.location.href.indexOf('kinderwunschzentren/?_') > 0) {
          $('html, body').animate({
            scrollTop: $('#search-filter-results-8030').offset().top
          }, 'slow');
        }
      });
    }(jQuery));
    </script>
    Anonymous
    #214322

    This is it. Thanks a lot and have a nice day!
    Georg

Viewing 7 posts – 1 through 7 (of 7 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.