Horizontal data update is not working on scroll

前端 未结 3 2275
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 03:19

I have a big array and I need to render it into a table. Instead of rendering all items I am rendering only few items horizontally and vertically. Then on scroll based on mouse

3条回答
  •  梦如初夏
    2021-02-20 03:50

    The problem is that you are hooking your onmousewheel event on #foo but don't realize that #foo is only as big as the data it contain. If you make the following change (i.e. take #wrapper instead of #foo)

    var listHold = document.getElementById('wrapper');
    

    You'll notice that the value do get updated.

提交回复
热议问题