jQuery: snapped scrolling - possible?

后端 未结 2 1459
暗喜
暗喜 2021-01-19 03:39

I\'m having a scrollable table with fixed header. Would it be possible to have \"snapped scrolling\" on the scrollbar - which means that the table rows won\'t scroll pixel b

2条回答
  •  温柔的废话
    2021-01-19 04:34

    What I would do is have a 0px-wide Dummy DIV—with a scrollbar—set to the same height as the Target DIV—with no scrollbar.

    I would then track the scroll-offset of the Dummy DIV for setting the Target DIV's scroll attribute. It would feel fluid, natural, and the most transparent to the user, which is really important for a good experience.

提交回复
热议问题