Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Smooth scrolling doesn't work

    Bug Reports
    2
    5
    495
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PapaSasha last edited by

      Hi guys,

      Can you help me with smooth scrolling on my website. Script works but without smooth scrolling.
      Website is under construction but you can try this on the menu below cover page: https://aplace.pl/video#

      Thanks in advance.

      Best,
      Alexander

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Hi @PapaSasha

        what is the script you are using?

        Best!

        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • P
          PapaSasha last edited by

          Hi @mariusjopen

          This one:
          <script>
          jQuery(document).ready(function(){
          jQuery('body').on('click', '#view-more', function(event) {
          event.preventDefault();
          var id = jQuery(this).attr('href');
          jQuery('html, body').animate( { scrollTop: jQuery(id).offset().top }, 750, 'easeOutExpo' );
          });
          })
          <script>

          Best,
          Alexander

          P 1 Reply Last reply Reply Quote 0
          • P
            PapaSasha @PapaSasha last edited by

            Hi @mariusjopen,
            Do you have any ideas how to solve this technical issue?
            I'd be grateful for your help.

            Best,
            Alexander

            1 Reply Last reply Reply Quote 0
            • mariusjopen
              mariusjopen Global Moderator last edited by

              Hi @PapaSasha

              ok. Try this code here:

              <script>
              jQuery(document).on("click", "#view-more", function(event) {
              
                  event.preventDefault();
                  
                  jQuery('html, body').animate({
                      scrollTop: jQuery("#view-more-anchor").offset().top
                  }, 500);
              
              });
              </script>
              

              You need to make two divs of course. One with the ID #view-more; and the other one with the ID #view-more-anchor;.

              In your code you also did not consider this:
              http://laytheme.com/documentation.html#custom-javascript

              Best!

              Marius

              www.mariusjopen.world

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Before you post

              Use the Search Feature. Maybe there is already a solution to your issue.

              1. Update Lay Theme and all Lay Theme Addons
              2. Disable all Plugins
              3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
              4. Now see if your problem solved itself
              5. Go here, see if your problem is listed here:
              Troubleshooting

              When you post:
              1. Post a link to where the problem is
              2. If the problem is difficult to explain, post screenshots / link to a video to explain it

              Thanks!

              Online Users

              S

              Recent Topics

              • T

                OpenType Feature

              • T

                Split Screen just on front page / subpages without the split?

              • T

                problem when I click on the category filter buttons on mobile

              • G

                z index has different behaviors on different pages

              laytheme.com