1

I have a button with the id #calendly-scroll. When the button is clicked it scrolls the page down 150px, only on the mobile screens.

It works fine on Chrome and Firefox mobile browsers.

it does not work on Safari mobile.

if(window.outerWidth < 425) {   
    $(document).ready(function() {
        $("#calendly-scroll").click(function(event){
            $('html, body').animate({scrollTop: '+=150px'}, 800);
        });
    }); 
}
Nur Islam
  • 11
  • 1
  • Do you have any CSS on the `html` or `body`? Are you getting any errors in the console? – user19103974 Aug 12 '22 at 16:10
  • Possible duplicate: [jQuery scrollTop() doesn't seem to work in Safari or Chrome (Windows)](https://stackoverflow.com/questions/1830080/jquery-scrolltop-doesnt-seem-to-work-in-safari-or-chrome-windows) – Andreas Aug 12 '22 at 16:10
  • Reasonable question, but it would be super helpful to add a stack snippet or link to jsFiddle with a full repro so folks can check it out themselves more easily – Socko Aug 12 '22 at 16:41

0 Answers0