How to disable scrolling until animation is complete?

后端 未结 2 1647
孤独总比滥情好
孤独总比滥情好 2021-01-01 23:39

I am using this code to scroll to a certain element on my page:

$(\"html, body\").animate({scrollTop: $(\".myDiv\").offset().top}, 300);

It

2条回答
  •  抹茶落季
    2021-01-02 00:00

    an idea - try hooking to the scroll event and use http://api.jquery.com/stop/ to stop your animation .. bad idea..

    same problem with a solution - let user scrolling stop jquery animation of scrolltop?

提交回复
热议问题