window.scroll function freezes firefox

后端 未结 3 1777
野性不改
野性不改 2021-01-13 01:29

I\'m working on a page with a fixed menu that picks up after the user has scrolled a certain distance from the top, and as they scroll down the page, different links from th

3条回答
  •  既然无缘
    2021-01-13 02:00

    In addition to the other issues, $('body').scrollTop() will always return 0 in Firefox. When setHash() runs $('html,body').scrollTop(scrollmem);}, it will jump to the top of the screen, which looks exactly like being stuck at the top of the screen when the user first loads the page. $(window).scrollTop(), in conjunction with throttling, will solve this problem.

提交回复
热议问题