infinite-viewer icon indicating copy to clipboard operation
infinite-viewer copied to clipboard

How to synchronize the scrolling of multiple `infinite-viewers` instance?

Open StringKe opened this issue 2 years ago • 3 comments

StringKe avatar Apr 12 '22 08:04 StringKe

InfiniteViewer instance has scroll-related methods such as scrollTo and scrollBy. I think you should use them.

daybrush avatar Apr 16 '22 11:04 daybrush

Suppose I have two infinite-viewers that both scroll through onScroll, the first trigger will operate the second, so the second onScroll will also trigger, so the operation of the first will cause infinite recursion error.

StringKe avatar Apr 16 '22 13:04 StringKe

ref: left,right

left.onScroll = right.scrollTo(e.left,e.top) right.onScroll = left.scrollTo(e.left,e.top)

StringKe avatar Apr 16 '22 13:04 StringKe